mirror of
https://github.com/yiisoft/yii2.git
synced 2025-10-29 09:28:37 +08:00
PHPStan/Psalm annotations for base class constructors (#20413)
This commit is contained in:
@ -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 = [])
|
||||
{
|
||||
|
||||
@ -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 = [])
|
||||
{
|
||||
|
||||
@ -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 = [])
|
||||
{
|
||||
|
||||
@ -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 = [])
|
||||
{
|
||||
|
||||
@ -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 = [])
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user