From 4c312a269314f1a4070d8aae1055adec36099b70 Mon Sep 17 00:00:00 2001 From: Max Semenik Date: Thu, 7 Jun 2018 20:16:42 -0700 Subject: [PATCH] Get rid of call_user_func_array() Yay PHP7! Change-Id: I2ec13d1a51981c6922949bed0c7dd2525c48f591 --- includes/AbuseFilter.php | 2 +- includes/AbuseFilterHooks.php | 2 +- includes/AbuseFilterVariableHolder.php | 2 +- includes/parser/AFPUserVisibleException.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/AbuseFilter.php b/includes/AbuseFilter.php index 37a99bb77..cb52a3b6e 100644 --- a/includes/AbuseFilter.php +++ b/includes/AbuseFilter.php @@ -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; diff --git a/includes/AbuseFilterHooks.php b/includes/AbuseFilterHooks.php index 40639959c..9307fa575 100644 --- a/includes/AbuseFilterHooks.php +++ b/includes/AbuseFilterHooks.php @@ -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'; diff --git a/includes/AbuseFilterVariableHolder.php b/includes/AbuseFilterVariableHolder.php index 897201535..0d6ce56ec 100644 --- a/includes/AbuseFilterVariableHolder.php +++ b/includes/AbuseFilterVariableHolder.php @@ -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; } diff --git a/includes/parser/AFPUserVisibleException.php b/includes/parser/AFPUserVisibleException.php index 9bfb766c8..9358e8953 100644 --- a/includes/parser/AFPUserVisibleException.php +++ b/includes/parser/AFPUserVisibleException.php @@ -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 ); } }