Skip to content
PHP Ecosystem
Explore

CreateObjectConfiguration

API reference › PHPStan › rules › CreateObjectConfiguration

final readonly classyii2\extensions\phpstan\rules\CreateObjectConfiguration
Sourcesrc/rules/CreateObjectConfiguration.php

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

CreateObjectConfigurationResolver for the conditions under which a configuration is resolved.

PropertyTypeDescriptionDefined by
$calledClass readonly constructorstringClass through which createObject() is called, as PHPStan displays it.CreateObjectConfiguration
$classReflection readonly constructorPHPStan\Reflection\ClassReflectionClass Yii creates and configures.CreateObjectConfiguration
$options readonly constructorlist<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
MethodDescriptionDefined by
__construct()Stores the called class, resolved class and effective configuration options.CreateObjectConfiguration
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

ParameterTypeDescription
$calledClassstringClass through which createObject() is called, as PHPStan displays it.
$classReflectionPHPStan\Reflection\ClassReflectionClass Yii creates and configures.
$optionslist<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.