mirror of
				https://github.com/yiisoft/yii2.git
				synced 2025-10-31 18:47:33 +08:00 
			
		
		
		
	PHPStan/Psalm annotations for base class constructors (#20413)
This commit is contained in:
		| @ -23,6 +23,7 @@ Yii Framework 2 Change Log | |||||||
| - Enh #20400: Add PHPStan/Psalm annotations for `yii\web\User` (samuelrajan747) | - Enh #20400: Add PHPStan/Psalm annotations for `yii\web\User` (samuelrajan747) | ||||||
| - Enh #20395: Add PHPStan/Psalm annotations for `ActiveForm::validate` (samuelrajan747) | - Enh #20395: Add PHPStan/Psalm annotations for `ActiveForm::validate` (samuelrajan747) | ||||||
| - Enh #20397: Add PHPStan/Psalm annotations for `ArrayHelper::merge` (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 | 2.0.52 February 13, 2025 | ||||||
|  | |||||||
| @ -53,6 +53,9 @@ class Action extends Component | |||||||
|      * @param string $id the ID of this action |      * @param string $id the ID of this action | ||||||
|      * @param Controller $controller the controller that owns 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 |      * @param array $config name-value pairs that will be used to initialize the object properties | ||||||
|  |      * | ||||||
|  |      * @phpstan-param array<string, mixed> $config | ||||||
|  |      * @psalm-param array<string, mixed> $config | ||||||
|      */ |      */ | ||||||
|     public function __construct($id, $controller, $config = []) |     public function __construct($id, $controller, $config = []) | ||||||
|     { |     { | ||||||
|  | |||||||
| @ -37,6 +37,9 @@ class ActionEvent extends Event | |||||||
|      * Constructor. |      * Constructor. | ||||||
|      * @param Action $action the action associated with this action event. |      * @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 |      * @param array $config name-value pairs that will be used to initialize the object properties | ||||||
|  |      * | ||||||
|  |      * @phpstan-param array<string, mixed> $config | ||||||
|  |      * @psalm-param array<string, mixed> $config | ||||||
|      */ |      */ | ||||||
|     public function __construct($action, $config = []) |     public function __construct($action, $config = []) | ||||||
|     { |     { | ||||||
|  | |||||||
| @ -189,6 +189,9 @@ abstract class Application extends Module | |||||||
|      * @param array $config name-value pairs that will be used to initialize the object properties. |      * @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]]. |      * Note that the configuration must contain both [[id]] and [[basePath]]. | ||||||
|      * @throws InvalidConfigException if either [[id]] or [[basePath]] configuration is missing. |      * @throws InvalidConfigException if either [[id]] or [[basePath]] configuration is missing. | ||||||
|  |      * | ||||||
|  |      * @phpstan-param array<string, mixed> $config | ||||||
|  |      * @psalm-param array<string, mixed> $config | ||||||
|      */ |      */ | ||||||
|     public function __construct($config = []) |     public function __construct($config = []) | ||||||
|     { |     { | ||||||
|  | |||||||
| @ -69,6 +69,12 @@ class DynamicModel extends Model | |||||||
|      * Constructor. |      * Constructor. | ||||||
|      * @param array $attributes the attributes (name-value pairs, or names) being defined. |      * @param array $attributes the attributes (name-value pairs, or names) being defined. | ||||||
|      * @param array $config the configuration array to be applied to this object. |      * @param array $config the configuration array to be applied to this object. | ||||||
|  |      * | ||||||
|  |      * @phpstan-param array<string, mixed>|string[] $attributes | ||||||
|  |      * @psalm-param array<string, mixed>|string[] $attributes | ||||||
|  |      * | ||||||
|  |      * @phpstan-param array<string, mixed> $config | ||||||
|  |      * @psalm-param array<string, mixed> $config | ||||||
|      */ |      */ | ||||||
|     public function __construct(array $attributes = [], $config = []) |     public function __construct(array $attributes = [], $config = []) | ||||||
|     { |     { | ||||||
|  | |||||||
| @ -33,6 +33,9 @@ class InlineAction extends Action | |||||||
|      * @param Controller $controller the controller that owns this action |      * @param Controller $controller the controller that owns this action | ||||||
|      * @param string $actionMethod the controller method that this inline action is associated with |      * @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 |      * @param array $config name-value pairs that will be used to initialize the object properties | ||||||
|  |      * | ||||||
|  |      * @phpstan-param array<string, mixed> $config | ||||||
|  |      * @psalm-param array<string, mixed> $config | ||||||
|      */ |      */ | ||||||
|     public function __construct($id, $controller, $actionMethod, $config = []) |     public function __construct($id, $controller, $actionMethod, $config = []) | ||||||
|     { |     { | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Максим Спирков
					Максим Спирков