Stop doing $that = $this in includes/specials
authorRicordisamoa <ricordisamoa@openmailbox.org>
Thu, 11 Feb 2016 08:37:23 +0000 (09:37 +0100)
committerRicordisamoa <ricordisamoa@openmailbox.org>
Wed, 17 Feb 2016 22:25:58 +0000 (23:25 +0100)
Closures support $this as of PHP 5.4

Change-Id: I452761a6189f50f93158f6de063d31c029bc2ed3

includes/specials/SpecialBotPasswords.php
includes/specials/SpecialChangeContentModel.php

index 47e3316..11357fb 100644 (file)
@@ -84,7 +84,6 @@ class SpecialBotPasswords extends FormSpecialPage {
        }
 
        protected function getFormFields() {
-               $that = $this;
                $user = $this->getUser();
                $request = $this->getRequest();
 
index d495120..bf44b42 100644 (file)
@@ -68,7 +68,6 @@ class SpecialChangeContentModel extends FormSpecialPage {
        }
 
        protected function getFormFields() {
-               $that = $this;
                $fields = [
                        'pagetitle' => [
                                'type' => 'title',
@@ -91,10 +90,10 @@ class SpecialChangeContentModel extends FormSpecialPage {
                                '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;