InvalidBehaviorAsDefinition
API reference › PHPStan › rules › InvalidBehaviorAsDefinition
Represents an as option of a Yii::createObject() configuration that Component rejects, as found by
BehaviorDefinitionResolver.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$calledClass readonly constructor | string | Class through which createObject() is called, as PHPStan displays it. | InvalidBehaviorAsDefinition |
$definedClass readonly constructor | string| | Class that the option names, or null for a configuration array without a class or a rejected value. | InvalidBehaviorAsDefinition |
$line readonly constructor | int | Line to report: the option key, or the call when the configuration doesn’t locate it. | InvalidBehaviorAsDefinition |
$option readonly constructor | string | Option name as written, including the as prefix. | InvalidBehaviorAsDefinition |
$owner readonly constructor | string | Created component that receives the option, as PHPStan displays it. | InvalidBehaviorAsDefinition |
$resolvedClass readonly constructor | string| | Class that the container resolves the named behavior class to, or null when Component::__set() rejects the option itself. | InvalidBehaviorAsDefinition |
$valueType readonly constructor | string| | Description of a rejected value that is no class name or configuration array, or null otherwise. | InvalidBehaviorAsDefinition |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Stores a rejected as behavior definition and its diagnostic location. | InvalidBehaviorAsDefinition |
message() | Returns the diagnostic message, naming the call, the option, the owner and the defined and resolved classes. | InvalidBehaviorAsDefinition |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(string $calledClass, string $owner, string $option, int $line, string|null $definedClass, string|null $resolvedClass, string|null $valueType)Stores a rejected as behavior definition and its diagnostic location.
Parameters
| Parameter | Type | Description |
|---|---|---|
$calledClass | string | Class through which createObject() is called, as PHPStan displays it. |
$owner | string | Created component that receives the option, as PHPStan displays it. |
$option | string | Option name as written, including the as prefix. |
$line | int | Line to report: the option key, or the call when the configuration doesn’t locate it. |
$definedClass | string| | Class that the option names, or null for a configuration array without a class or a rejected value. |
$resolvedClass | string| | Class that the container resolves the named behavior class to, or null when Component::__set() rejects the option itself. |
$valueType | string| | Description of a rejected value that is no class name or configuration array, or null otherwise. |
message()
Section titled “message() ”public function message(): stringReturns the diagnostic message, naming the call, the option, the owner and the defined and resolved classes.
Returns
string