Convert a few call_user_func*() calls to native PHP syntax
Change-Id: I54d94f4369eb4fa0b0ebe892a1d6cc57b2bdb1f9
This commit is contained in:
parent
349a04cd10
commit
61c539126f
5 changed files with 5 additions and 5 deletions
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 ];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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] );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue