mirror of
https://github.com/yiisoft/yii2.git
synced 2025-10-30 01:56:35 +08:00
Fix #20442: Add PHPStan/Psalm annotations for yii\base\Controller methods: runAction, run, render, renderPartial and renderFile
This commit is contained in:
@ -8,6 +8,7 @@ Yii Framework 2 Change Log
|
|||||||
- Bug #20437: Fix PHPStan/Psalm annotations for `BaseArrayHelper::merge` (max-s-lab)
|
- Bug #20437: Fix PHPStan/Psalm annotations for `BaseArrayHelper::merge` (max-s-lab)
|
||||||
- Enh #20434: Added PHPStan/Psalm annotations for `hasMany` and `hasOne` methods (max-s-lab)
|
- Enh #20434: Added PHPStan/Psalm annotations for `hasMany` and `hasOne` methods (max-s-lab)
|
||||||
- Enh #20433: Added PHPStan/Psalm annotations for some controllers methods: `beforeAction`, `afterAction` and `bindActionParams` (max-s-lab)
|
- Enh #20433: Added PHPStan/Psalm annotations for some controllers methods: `beforeAction`, `afterAction` and `bindActionParams` (max-s-lab)
|
||||||
|
- Enh #20442: Add PHPStan/Psalm annotations for `yii\base\Controller` methods: `runAction`, `run`, `render`, `renderPartial` and `renderFile` (max-s-lab)
|
||||||
|
|
||||||
|
|
||||||
2.0.53 June 27, 2025
|
2.0.53 June 27, 2025
|
||||||
|
|||||||
@ -147,6 +147,9 @@ class Controller extends Component implements ViewContextInterface
|
|||||||
* @return mixed the result of the action.
|
* @return mixed the result of the action.
|
||||||
* @throws InvalidRouteException if the requested action ID cannot be resolved into an action successfully.
|
* @throws InvalidRouteException if the requested action ID cannot be resolved into an action successfully.
|
||||||
* @see createAction()
|
* @see createAction()
|
||||||
|
*
|
||||||
|
* @phpstan-param array<array-key, mixed> $params
|
||||||
|
* @psalm-param array<array-key, mixed> $params
|
||||||
*/
|
*/
|
||||||
public function runAction($id, $params = [])
|
public function runAction($id, $params = [])
|
||||||
{
|
{
|
||||||
@ -208,6 +211,9 @@ class Controller extends Component implements ViewContextInterface
|
|||||||
* @param array $params the parameters to be passed to the action.
|
* @param array $params the parameters to be passed to the action.
|
||||||
* @return mixed the result of the action.
|
* @return mixed the result of the action.
|
||||||
* @see runAction()
|
* @see runAction()
|
||||||
|
*
|
||||||
|
* @phpstan-param array<array-key, mixed> $params
|
||||||
|
* @psalm-param array<array-key, mixed> $params
|
||||||
*/
|
*/
|
||||||
public function run($route, $params = [])
|
public function run($route, $params = [])
|
||||||
{
|
{
|
||||||
@ -422,6 +428,9 @@ class Controller extends Component implements ViewContextInterface
|
|||||||
* These parameters will not be available in the layout.
|
* These parameters will not be available in the layout.
|
||||||
* @return string the rendering result.
|
* @return string the rendering result.
|
||||||
* @throws InvalidArgumentException if the view file or the layout file does not exist.
|
* @throws InvalidArgumentException if the view file or the layout file does not exist.
|
||||||
|
*
|
||||||
|
* @phpstan-param array<string, mixed> $params
|
||||||
|
* @psalm-param array<string, mixed> $params
|
||||||
*/
|
*/
|
||||||
public function render($view, $params = [])
|
public function render($view, $params = [])
|
||||||
{
|
{
|
||||||
@ -453,6 +462,9 @@ class Controller extends Component implements ViewContextInterface
|
|||||||
* @param array $params the parameters (name-value pairs) that should be made available in the view.
|
* @param array $params the parameters (name-value pairs) that should be made available in the view.
|
||||||
* @return string the rendering result.
|
* @return string the rendering result.
|
||||||
* @throws InvalidArgumentException if the view file does not exist.
|
* @throws InvalidArgumentException if the view file does not exist.
|
||||||
|
*
|
||||||
|
* @phpstan-param array<string, mixed> $params
|
||||||
|
* @psalm-param array<string, mixed> $params
|
||||||
*/
|
*/
|
||||||
public function renderPartial($view, $params = [])
|
public function renderPartial($view, $params = [])
|
||||||
{
|
{
|
||||||
@ -465,6 +477,9 @@ class Controller extends Component implements ViewContextInterface
|
|||||||
* @param array $params the parameters (name-value pairs) that should be made available in the view.
|
* @param array $params the parameters (name-value pairs) that should be made available in the view.
|
||||||
* @return string the rendering result.
|
* @return string the rendering result.
|
||||||
* @throws InvalidArgumentException if the view file does not exist.
|
* @throws InvalidArgumentException if the view file does not exist.
|
||||||
|
*
|
||||||
|
* @phpstan-param array<string, mixed> $params
|
||||||
|
* @psalm-param array<string, mixed> $params
|
||||||
*/
|
*/
|
||||||
public function renderFile($file, $params = [])
|
public function renderFile($file, $params = [])
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user