# ExternalActionConfigurationResolver

> Resolves the external action definitions of a yii\base\Controller::actions() return statement whose assignment path Yii makes certain.

[API reference](/docs/api/index.md) › [PHPStan](/docs/extensions/phpstan/reference/index.md) › [rules](/docs/extensions/phpstan/reference/rules/index.md) › ExternalActionConfigurationResolver

| final class | `yii2\extensions\phpstan\rules\ExternalActionConfigurationResolver` |
| --- | --- |
| Source | [`src/rules/ExternalActionConfigurationResolver.php`](https://github.com/yii2-extensions/phpstan/blob/main/src/rules/ExternalActionConfigurationResolver.php#L25) |

Resolves the external action definitions of a [`Controller::actions()`](/docs/api/yii/base/controller/index.md#method-actions) return statement whose assignment path
Yii makes certain.

Requires the `actions()` method of a concrete, non-anonymous controller that inherits
[`Controller::createAction()`](/docs/api/yii/base/controller/index.md#method-createAction), outside closures and traits, and a map with string action IDs proven as
[`ObjectConfigurationReader::options()`](/docs/extensions/phpstan/reference/rules/objectconfigurationreader/index.md#method-options) describes; an empty ID is left out. Each array definition is resolved as
`Yii::createObject($definition, [$id, $this])` under [`CreateObjectConstructionContract::externalAction()`](/docs/extensions/phpstan/reference/rules/createobjectconstructioncontract/index.md#method-externalAction).

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`__construct()`](#method-__construct) | Initializes the resolver with class reflection and the analysis configuration. | `ExternalActionConfigurationResolver` |
| [`resolve()`](#method-resolve) | Returns the proven definitions of the returned map, in map order; other definitions are left out. | `ExternalActionConfigurationResolver` |

## Method details

### __construct() <span id="method-__construct"></span>

```php
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\Reflection\ReflectionProvider` | Provides class reflection for the created actions. |
| `$serviceMap` | [`yii2\extensions\phpstan\ServiceMap`](/docs/extensions/phpstan/reference/servicemap/index.md) | Service and component map for Yii Application static analysis. |

### resolve() <span id="method-resolve"></span>

```php
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()`](/docs/extensions/phpstan/reference/rules/createobjectconfigurationresolver/index.md#method-resolveTypeOptions).

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$node` | `PhpParser\Node\Stmt\Return_` | Return statement to inspect. |
| `$scope` | `PHPStan\Analyser\DependencyTracker&PHPStan\Analyser\Scope` | Current PHPStan analysis scope. |

**Returns**

`list<`[`ExternalActionConfiguration`](/docs/extensions/phpstan/reference/rules/externalactionconfiguration/index.md)`>`