mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-23 21:53:35 +00:00
Get rid of call_user_func_array()
Yay PHP7! Change-Id: I2ec13d1a51981c6922949bed0c7dd2525c48f591
This commit is contained in:
parent
1eb684447e
commit
4c312a2693
|
@ -1018,7 +1018,7 @@ class AbuseFilter {
|
|||
$status = Status::newGood( $actionsTaken );
|
||||
|
||||
foreach ( $messages as $msg ) {
|
||||
call_user_func_array( [ $status, 'fatal' ], $msg );
|
||||
$status->fatal( ...$msg );
|
||||
}
|
||||
|
||||
return $status;
|
||||
|
|
|
@ -191,7 +191,7 @@ class AbuseFilterHooks {
|
|||
// The value is a nested structure keyed by filter id, which doesn't make sense when we only
|
||||
// return the result from one filter. Flatten it to a plain array of actions.
|
||||
$actionsTaken = array_values( array_unique(
|
||||
call_user_func_array( 'array_merge', array_values( $status->getValue() ) )
|
||||
array_merge( ...array_values( $status->getValue() ) )
|
||||
) );
|
||||
$code = ( $actionsTaken === [ 'warn' ] ) ? 'abusefilter-warning' : 'abusefilter-disallowed';
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ class AbuseFilterVariableHolder {
|
|||
*/
|
||||
public static function merge() {
|
||||
$newHolder = new AbuseFilterVariableHolder;
|
||||
call_user_func_array( [ $newHolder, "addHolders" ], func_get_args() );
|
||||
$newHolder->addHolders( ...func_get_args() );
|
||||
|
||||
return $newHolder;
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ class AFPUserVisibleException extends AFPException {
|
|||
// abusefilter-exception-notlist, abusefilter-exception-unclosedcomment
|
||||
return wfMessage(
|
||||
'abusefilter-exception-' . $this->mExceptionID,
|
||||
array_merge( [ $this->mPosition ], $this->mParams )
|
||||
$this->mPosition, ...$this->mParams
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue