ExternalActionConfigurationResolver
API reference › PHPStan › rules › ExternalActionConfigurationResolver
Resolves the external action definitions of a Controller::actions() return statement whose assignment path
Yii makes certain.
Requires the actions() method of a concrete, non-anonymous controller that inherits
Controller::createAction(), outside closures and traits, and a map with string action IDs proven as
ObjectConfigurationReader::options() describes; an empty ID is left out. Each array definition is resolved as
Yii::createObject($definition, [$id, $this]) under CreateObjectConstructionContract::externalAction().
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Initializes the resolver with class reflection and the analysis configuration. | ExternalActionConfigurationResolver |
resolve() | Returns the proven definitions of the returned map, in map order; other definitions are left out. | ExternalActionConfigurationResolver |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(PHPStan\Reflection\ReflectionProvider $reflectionProvider, yii2\extensions\phpstan\ServiceMap $serviceMap)Initializes the resolver with class reflection and the analysis configuration.
Parameters
| Parameter | Type | Description |
|---|---|---|
$reflectionProvider | PHPStan\ | Provides class reflection for the created actions. |
$serviceMap | yii2\ | Service and component map for Yii Application static analysis. |
resolve()
Section titled “resolve() ”public function resolve(PhpParser\Node\Stmt\Return_ $node, PHPStan\Analyser\DependencyTracker&PHPStan\Analyser\Scope $scope): list<yii2\extensions\phpstan\rules\ExternalActionConfiguration>Returns the proven definitions of the returned map, in map order; other definitions are left out.
Records the declaration dependency of the controller and those of
CreateObjectConfigurationResolver::resolveTypeOptions().
Parameters
| Parameter | Type | Description |
|---|---|---|
$node | PhpParser\ | Return statement to inspect. |
$scope | PHPStan\ | Current PHPStan analysis scope. |
Returns