# CreateObjectConfiguration

> Represents a yii\BaseYii::createObject() configuration whose class and assignment path are proven.

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

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

Represents a [`BaseYii::createObject()`](/docs/api/yii/baseyii/index.md#method-createObject) configuration whose class and assignment path are proven.

[`CreateObjectConfigurationResolver`](/docs/extensions/phpstan/reference/rules/createobjectconfigurationresolver/index.md) for the conditions under which a configuration is resolved.

## Properties

| Property | Type | Description | Defined by |
| --- | --- | --- | --- |
| <span id="property-calledClass"></span>`$calledClass` readonly constructor | `string` | Class through which `createObject()` is called, as PHPStan displays it. | `CreateObjectConfiguration` |
| <span id="property-classReflection"></span>`$classReflection` readonly constructor | `PHPStan\Reflection\ClassReflection` | Class Yii creates and configures. | `CreateObjectConfiguration` |
| <span id="property-options"></span>`$options` readonly constructor | `list<array{string, int, PhpParser\Node\Expr\|PHPStan\Type\Type}>` | Name, reported line and effective value of each distinct option that Yii assigns, in first-occurrence order: the value expression of an array literal whose keys are all literal strings, otherwise the value type of the constant native array. `class` and `__class` are present only when they come from a constructor argument used as the configuration. | `CreateObjectConfiguration` |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`__construct()`](#method-__construct) | Stores the called class, resolved class and effective configuration options. | `CreateObjectConfiguration` |

## Method details

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

```php
public function __construct(string $calledClass, PHPStan\Reflection\ClassReflection $classReflection, list<array{string, int, PhpParser\Node\Expr|PHPStan\Type\Type}> $options)
```

Stores the called class, resolved class and effective configuration options.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$calledClass` | `string` | Class through which `createObject()` is called, as PHPStan displays it. |
| `$classReflection` | `PHPStan\Reflection\ClassReflection` | Class Yii creates and configures. |
| `$options` | `list<array{string, int, PhpParser\Node\Expr\|PHPStan\Type\Type}>` | Name, reported line and effective value of each distinct option that Yii assigns, in first-occurrence order: the value expression of an array literal whose keys are all literal strings, otherwise the value type of the constant native array. `class` and `__class` are present only when they come from a constructor argument used as the configuration. |