Skip to content
PHP Ecosystem
Explore

ExternalActionConfigurationResolver

API reference › PHPStan › rules › ExternalActionConfigurationResolver

final classyii2\extensions\phpstan\rules\ExternalActionConfigurationResolver
Sourcesrc/rules/ExternalActionConfigurationResolver.php

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().

MethodDescriptionDefined 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
public function __construct(PHPStan\Reflection\ReflectionProvider $reflectionProvider, yii2\extensions\phpstan\ServiceMap $serviceMap)

Initializes the resolver with class reflection and the analysis configuration.

Parameters

ParameterTypeDescription
$reflectionProviderPHPStan\Reflection\ReflectionProviderProvides class reflection for the created actions.
$serviceMapyii2\extensions\phpstan\ServiceMapService and component map for Yii Application static analysis.
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

ParameterTypeDescription
$nodePhpParser\Node\Stmt\Return_Return statement to inspect.
$scopePHPStan\Analyser\DependencyTracker&PHPStan\Analyser\ScopeCurrent PHPStan analysis scope.

Returns

list<ExternalActionConfiguration>