Get rid of call_user_func_array()

Yay PHP7!

Change-Id: I2ec13d1a51981c6922949bed0c7dd2525c48f591
This commit is contained in:
Max Semenik 2018-06-07 20:16:42 -07:00
parent 1eb684447e
commit 4c312a2693
4 changed files with 4 additions and 4 deletions

View file

@ -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;

View file

@ -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';

View file

@ -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;
}

View file

@ -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
);
}
}