Methods |
public
|
__construct(
string $mainType,
array<int, Type> $types,
?Type $subtractedType = null,
?ClassReflection $classReflection = null,
array<int, TemplateTypeVariance> $variances = [],
)
|
#
|
public
|
describe(VerbosityLevel $level): string
|
#
|
public
|
equals(Type $type): bool
|
#
|
public
|
getReferencedClasses(): string[]
|
#
|
public
|
getTypes(): array<int, Type>
|
#
|
public
|
getVariances(): array<int, TemplateTypeVariance>
|
#
|
public
|
accepts(Type $type, bool $strictTypes): TrinaryLogic
|
#
|
public
|
acceptsWithReason(Type $type, bool $strictTypes): AcceptsResult
This is like accepts() but gives reasons
why the type was not/might not be accepted in some non-intuitive scenarios.
This is like accepts() but gives reasons
why the type was not/might not be accepted in some non-intuitive scenarios.
In PHPStan 2.0 this method will be removed and the return type of accepts()
will change to AcceptsResult.
Overrides
|
#
|
public
|
isSuperTypeOf(Type $type): TrinaryLogic
|
#
|
public
|
getClassReflection(): ?ClassReflection
|
#
|
public
|
getProperty(string $propertyName, ClassMemberAccessAnswerer $scope): PropertyReflection
|
#
|
public
|
getUnresolvedPropertyPrototype(
string $propertyName,
ClassMemberAccessAnswerer $scope,
): UnresolvedPropertyPrototypeReflection
|
#
|
public
|
getMethod(string $methodName, ClassMemberAccessAnswerer $scope): ExtendedMethodReflection
|
#
|
public
|
getUnresolvedMethodPrototype(string $methodName, ClassMemberAccessAnswerer $scope): UnresolvedMethodPrototypeReflection
|
#
|
public
|
inferTemplateTypes(Type $receivedType): TemplateTypeMap
Infers template types
Infers template types
Infers the real Type of the TemplateTypes found in $this, based on
the received Type.
Implements
|
#
|
public
|
getReferencedTemplateTypes(TemplateTypeVariance $positionVariance): array
Returns the template types referenced by this Type, recursively
Returns the template types referenced by this Type, recursively
The return value is a list of TemplateTypeReferences, who contain the
referenced template type as well as the variance position in which it was
found.
For example, calling this on array<Foo<T>,Bar> (with T a template type)
will return one TemplateTypeReference for the type T.
Parameters
$positionVariance |
The variance position in
which the receiver type was
found.
|
Implements
|
#
|
public
|
traverse(callable $cb): Type
Traverses inner types
Traverses inner types
Returns a new instance with all inner types mapped through $cb. Might
return the same instance if inner types did not change.
Overrides
|
#
|
public
|
traverseSimultaneously(Type $right, callable $cb): Type
Traverses inner types while keeping the same context in another type.
Traverses inner types while keeping the same context in another type.
Overrides
|
#
|
protected
|
recreate(string $className, Type[] $types, ?Type $subtractedType, TemplateTypeVariance[] $variances = []): self
|
#
|
public
|
changeSubtractedType(?Type $subtractedType): Type
|
#
|
public
|
toPhpDocNode(): TypeNode
|
#
|
public
static
|
__set_state(mixed[] $properties): Type
|
#
|