ValidatorUnknownOptionRule
API reference › PHPStan › rules › ValidatorUnknownOptionRule
Reports unknown options in model validation rules using closures, qualified classes or Yii’s declared built-in aliases.
Assumes the declared alias table has not been changed at runtime. Method names and uncertain dispatches stand aside.
ValidatorConfigurationResolver for the dispatch and ObjectOptionAssignment for the assignment semantics.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Initializes static class reflection and the analysis service map. | ValidatorUnknownOptionRule |
getNodeType() | Returns the node class this rule analyses. | ValidatorUnknownOptionRule |
processNode() | Returns diagnostics for unknown options explicitly written in model rules. | ValidatorUnknownOptionRule |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(PHPStan\Reflection\ReflectionProvider $reflectionProvider, yii2\extensions\phpstan\ServiceMap $serviceMap)Initializes static class reflection and the analysis service map.
Parameters
| Parameter | Type | Description |
|---|---|---|
$reflectionProvider | PHPStan\ | |
$serviceMap | yii2\ |
getNodeType()
Section titled “getNodeType() ”public function getNodeType(): class-string<PhpParser\Node\Stmt\Return_>Returns the node class this rule analyses.
Returns
class-string<PhpParser\Node\Stmt\Return_>
processNode()
Section titled “processNode() ”public function processNode(PhpParser\Node\Stmt\Return_ $node, PHPStan\Analyser\DependencyTracker&PHPStan\Analyser\Scope $scope): list<PHPStan\Rules\IdentifierRuleError>Returns diagnostics for unknown options explicitly written in model rules.
Parameters
| Parameter | Type | Description |
|---|---|---|
$node | PhpParser\ | Return statement to inspect. |
$scope | PHPStan\ | Current PHPStan analysis scope. |
Returns
list<PHPStan\Rules\IdentifierRuleError>: Errors at each rule’s line.