Replace use of &$this

Use of &$this doesn't work in PHP 7.1. For callbacks to methods like
array_map() it's completely unnecessary, while for hooks we still need
to pass a reference and so we need to copy $this into a local variable.

Bug: T153505
Change-Id: I065808a2c4dc9bcb80861a79b46cf4b446b70d65
This commit is contained in:
Brad Jorsch 2017-01-31 22:51:00 -05:00
parent 8427731a58
commit 8bfc15c729

View file

@ -674,7 +674,7 @@ class SimpleCaptcha {
$newLinks = $this->findLinks( $title, $newtext );
}
$unknownLinks = array_filter( $newLinks, [ &$this, 'filterLink' ] );
$unknownLinks = array_filter( $newLinks, [ $this, 'filterLink' ] );
$addedLinks = array_diff( $unknownLinks, $oldLinks );
$numLinks = count( $addedLinks );