diff --git a/includes/TemplateParser.php b/includes/TemplateParser.php index 75494b1ed8e..11a8e85656a 100644 --- a/includes/TemplateParser.php +++ b/includes/TemplateParser.php @@ -220,6 +220,6 @@ class TemplateParser { */ public function processTemplate( $templateName, $args, array $scopes = [] ) { $template = $this->getTemplate( $templateName ); - return call_user_func( $template, $args, $scopes ); + return $template( $args, $scopes ); } } diff --git a/includes/WebResponse.php b/includes/WebResponse.php index 9396a41a766..45cc7df7a60 100644 --- a/includes/WebResponse.php +++ b/includes/WebResponse.php @@ -205,7 +205,7 @@ class WebResponse { wfDebugLog( 'cookie', 'already set ' . $func . ': "' . implode( '", "', $data ) . '"' ); } else { wfDebugLog( 'cookie', $func . ': "' . implode( '", "', $data ) . '"' ); - if ( call_user_func_array( $func, array_values( $data ) ) ) { + if ( $func( ...array_values( $data ) ) ) { self::$setCookies[$key] = $deleting ? null : [ $func, $data ]; } } diff --git a/includes/filerepo/file/File.php b/includes/filerepo/file/File.php index 923484add8c..c3b519944c1 100644 --- a/includes/filerepo/file/File.php +++ b/includes/filerepo/file/File.php @@ -207,7 +207,7 @@ abstract class File implements IDBAccessObject { if ( !is_callable( $function ) ) { return null; } else { - $this->$name = call_user_func( $function ); + $this->$name = $function(); return $this->$name; } diff --git a/includes/htmlform/fields/HTMLInfoField.php b/includes/htmlform/fields/HTMLInfoField.php index c0dbf500d2e..b4aab4a020c 100644 --- a/includes/htmlform/fields/HTMLInfoField.php +++ b/includes/htmlform/fields/HTMLInfoField.php @@ -22,7 +22,7 @@ class HTMLInfoField extends HTMLFormField { public function getDefault() { $default = parent::getDefault(); if ( $default instanceof Closure ) { - $default = call_user_func( $default, $this->mParams ); + $default = $default( $this->mParams ); } return $default; } diff --git a/includes/registration/ExtensionRegistry.php b/includes/registration/ExtensionRegistry.php index 88d9fd3f99f..e3df4999875 100644 --- a/includes/registration/ExtensionRegistry.php +++ b/includes/registration/ExtensionRegistry.php @@ -374,7 +374,7 @@ class ExtensionRegistry { } throw new UnexpectedValueException( "callback '$cb' is not callable" ); } - call_user_func( $cb, $info['credits'][$name] ); + $cb( $info['credits'][$name] ); } }