PHPStan/Psalm annotations for base class constructors (#20413)

This commit is contained in:
Максим Спирков
2025-06-13 23:27:33 +04:00
committed by GitHub
parent ed4f888136
commit b47f81ea27
6 changed files with 19 additions and 0 deletions

View File

@ -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<string, mixed> $config
* @psalm-param array<string, mixed> $config
*/
public function __construct($id, $controller, $config = [])
{

View File

@ -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<string, mixed> $config
* @psalm-param array<string, mixed> $config
*/
public function __construct($action, $config = [])
{

View File

@ -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<string, mixed> $config
* @psalm-param array<string, mixed> $config
*/
public function __construct($config = [])
{

View File

@ -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, 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 = [])
{

View File

@ -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<string, mixed> $config
* @psalm-param array<string, mixed> $config
*/
public function __construct($id, $controller, $actionMethod, $config = [])
{