diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index 45702b2c2f..a22191d30f 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -23,6 +23,7 @@ Yii Framework 2 Change Log - Enh #20400: Add PHPStan/Psalm annotations for `yii\web\User` (samuelrajan747) - Enh #20395: Add PHPStan/Psalm annotations for `ActiveForm::validate` (samuelrajan747) - Enh #20397: Add PHPStan/Psalm annotations for `ArrayHelper::merge` (samuelrajan747) +- Enh #20413: Add PHPStan/Psalm annotations for `Action`, `ActionEvent`, `Application`, `DynamicModel` and `InlineAction` (max-s-lab) 2.0.52 February 13, 2025 diff --git a/framework/base/Action.php b/framework/base/Action.php index bee453fc75..d3ab94d8cb 100644 --- a/framework/base/Action.php +++ b/framework/base/Action.php @@ -53,6 +53,9 @@ class Action extends Component * @param string $id the ID of this action * @param Controller $controller the controller that owns this action * @param array $config name-value pairs that will be used to initialize the object properties + * + * @phpstan-param array $config + * @psalm-param array $config */ public function __construct($id, $controller, $config = []) { diff --git a/framework/base/ActionEvent.php b/framework/base/ActionEvent.php index ab03d7366f..4893664faa 100644 --- a/framework/base/ActionEvent.php +++ b/framework/base/ActionEvent.php @@ -37,6 +37,9 @@ class ActionEvent extends Event * Constructor. * @param Action $action the action associated with this action event. * @param array $config name-value pairs that will be used to initialize the object properties + * + * @phpstan-param array $config + * @psalm-param array $config */ public function __construct($action, $config = []) { diff --git a/framework/base/Application.php b/framework/base/Application.php index e2944b82a5..10c24c8233 100644 --- a/framework/base/Application.php +++ b/framework/base/Application.php @@ -189,6 +189,9 @@ abstract class Application extends Module * @param array $config name-value pairs that will be used to initialize the object properties. * Note that the configuration must contain both [[id]] and [[basePath]]. * @throws InvalidConfigException if either [[id]] or [[basePath]] configuration is missing. + * + * @phpstan-param array $config + * @psalm-param array $config */ public function __construct($config = []) { diff --git a/framework/base/DynamicModel.php b/framework/base/DynamicModel.php index eb4ee9649c..a7288a997f 100644 --- a/framework/base/DynamicModel.php +++ b/framework/base/DynamicModel.php @@ -69,6 +69,12 @@ class DynamicModel extends Model * Constructor. * @param array $attributes the attributes (name-value pairs, or names) being defined. * @param array $config the configuration array to be applied to this object. + * + * @phpstan-param array|string[] $attributes + * @psalm-param array|string[] $attributes + * + * @phpstan-param array $config + * @psalm-param array $config */ public function __construct(array $attributes = [], $config = []) { diff --git a/framework/base/InlineAction.php b/framework/base/InlineAction.php index 73804dd3eb..6e6b1be02f 100644 --- a/framework/base/InlineAction.php +++ b/framework/base/InlineAction.php @@ -33,6 +33,9 @@ class InlineAction extends Action * @param Controller $controller the controller that owns this action * @param string $actionMethod the controller method that this inline action is associated with * @param array $config name-value pairs that will be used to initialize the object properties + * + * @phpstan-param array $config + * @psalm-param array $config */ public function __construct($id, $controller, $actionMethod, $config = []) {