Convert a few call_user_func*() calls to native PHP syntax

Change-Id: I54d94f4369eb4fa0b0ebe892a1d6cc57b2bdb1f9
This commit is contained in:
Max Semenik 2019-03-07 19:25:40 -08:00
parent 349a04cd10
commit 61c539126f
5 changed files with 5 additions and 5 deletions

View file

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

View file

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

View file

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

View file

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

View file

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