Browse Source

Change call_user_func_array to ...$args (#15029)

tags/3.0.0-alpha1
243083df 7 years ago committed by Alexander Makarov
parent
commit
08cafaa2ee
  1. 2
      framework/base/Action.php
  2. 2
      framework/base/Component.php
  3. 2
      framework/base/InlineAction.php

2
framework/base/Action.php

@ -91,7 +91,7 @@ class Action extends Component
Yii::$app->requestedParams = $args;
}
if ($this->beforeRun()) {
$result = call_user_func_array([$this, 'run'], $args);
$result = $this->run(...$args);
$this->afterRun();
return $result;

2
framework/base/Component.php

@ -288,7 +288,7 @@ class Component extends BaseObject
$this->ensureBehaviors();
foreach ($this->_behaviors as $object) {
if ($object->hasMethod($name)) {
return call_user_func_array([$object, $name], $params);
return $object->$name(...$params);
}
}
throw new UnknownMethodException('Calling unknown method: ' . get_class($this) . "::$name()");

2
framework/base/InlineAction.php

@ -54,6 +54,6 @@ class InlineAction extends Action
Yii::$app->requestedParams = $args;
}
return call_user_func_array([$this->controller, $this->actionMethod], $args);
return $this->controller->{$this->actionMethod}(...$args);
}
}

Loading…
Cancel
Save