Closures support $this as of PHP 5.4
Change-Id: I452761a6189f50f93158f6de063d31c029bc2ed3
}
protected function getFormFields() {
- $that = $this;
$user = $this->getUser();
$request = $this->getRequest();
}
protected function getFormFields() {
- $that = $this;
$fields = [
'pagetitle' => [
'type' => 'title',
'reason' => [
'type' => 'text',
'name' => 'reason',
- 'validation-callback' => function( $reason ) use ( $that ) {
+ 'validation-callback' => function( $reason ) {
$match = EditPage::matchSummarySpamRegex( $reason );
if ( $match ) {
- return $that->msg( 'spamprotectionmatch', $match )->parse();
+ return $this->msg( 'spamprotectionmatch', $match )->parse();
}
return true;