Skip to content
PHP Ecosystem
Explore

NewObjectConfiguration

API reference › PHPStan › rules › NewObjectConfiguration

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

Represents the configuration of a direct new construction whose class and assignment path are proven.

NewObjectConfigurationResolver for the conditions under which a configuration is resolved.

PropertyTypeDescriptionDefined by
$classReflection readonly constructorPHPStan\Reflection\ClassReflectionClass that new constructs and configures.NewObjectConfiguration
$options readonly constructorlist<array{string, int, PhpParser\Node\Expr|PHPStan\Type\Type}>Name, reported line and effective value of each distinct option, in first-occurrence order, as ObjectConfigurationReader::options() reads them. Every key is assigned, class, __class and __construct() included.NewObjectConfiguration
MethodDescriptionDefined by
__construct()Stores the constructed class and effective configuration options.NewObjectConfiguration
public function __construct(PHPStan\Reflection\ClassReflection $classReflection, list<array{string, int, PhpParser\Node\Expr|PHPStan\Type\Type}> $options)

Stores the constructed class and effective configuration options.

Parameters

ParameterTypeDescription
$classReflectionPHPStan\Reflection\ClassReflectionClass that new constructs and configures.
$optionslist<array{string, int, PhpParser\Node\Expr|PHPStan\Type\Type}>Name, reported line and effective value of each distinct option, in first-occurrence order, as ObjectConfigurationReader::options() reads them. Every key is assigned, class, __class and __construct() included.