final |
|---|
Controls how aggressively Type::generalize() widens a type.
Generalization is the process of widening a specific type to a broader one. For example, generalizing ConstantStringType('hello') yields StringType. This is used when PHPStan needs to merge types across loop iterations or branches where tracking precise constant values is impractical.
Three levels of precision:
Used as a parameter to Type::generalize():
$type->generalize(GeneralizePrecision::lessSpecific())
| Methods | ||
|---|---|---|
public
static
|
lessSpecific(): self
|
# |
public
static
|
moreSpecific(): self
|
# |
public
static
|
templateArgument(): self
|
# |