Namespace PHPStan\Type

Classes
AcceptsResult

Result of a Type::accepts() check — whether one type accepts another.

ArrayType
BenevolentUnionType
BooleanType
CallableType
CircularTypeAliasErrorType
ClassStringType
ClosureType
ClosureTypeFactory
ConditionalType
ConditionalTypeForParameter
ConstantTypeHelper
ErrorType
FileTypeMapper
FloatType
GeneralizePrecision

Controls how aggressively Type::generalize() widens a type.

IntegerRangeType
IntegerType
IntersectionType
IsSuperTypeOfResult

Result of a Type::isSuperTypeOf() check — whether one type is a supertype of another.

IterableType
KeyOfType
MixedType
NativeTypePosition

Where a native PHP type declaration is written, and for which PHP version.

NeverType
NewObjectType
NonAcceptingNeverType
NullType
ObjectShapeType
ObjectType
ObjectWithoutClassType
OffsetAccessType
RecursiveType

A type that contains itself, like @phpstan-type Selection = array<string, true|Selection> or __recursive<array<string, true|__recursion>> in a stub.

ResourceType
SimultaneousTypeTraverser
StaticType
StringRefinement

Bits of Type::getStringRefinement(): the strings split into cells that the string accessory types never split further. Every refinement of string - a conjunction of accessories - holds whole cells, so the union of two refinements is a refinement exactly when some conjunction holds the cells of both, and a constant string fills a cell only when it is the cell's sole value (the empty string and '0').

StringType
ThisType
TypeCombinator
TypehintHelper
TypeKind

Bits of Type::getKindMask(): the kinds of values PHP tells apart by their type. A value is of exactly one kind, so two types whose masks share no bit share no value: their union cannot merge them into one member and their intersection is never.

TypeTraverser
TypeUtils
UnionType
ValueOfType
VerbosityLevel

Controls the verbosity of type descriptions in error messages.

VoidType
Interfaces
CompoundType

Marker interface for types that require bidirectional type comparison.

ConstantScalarType

A type whose value is known at analysis time — a compile-time constant scalar.

DynamicFunctionReturnTypeExtension

This is the interface dynamic return type extensions implement for functions.

DynamicFunctionSideEffectsExtension

This is the interface dynamic side effects extensions implement for functions. They describe the side effects of one call, such as a function that prints only for some arguments. They do not include the effects of the callables passed to the parameters flagged with @pure-unless-callable-is-impure, the analysis adds those.

DynamicFunctionThrowTypeExtension

This is the interface dynamic throw type extensions implement for functions.

DynamicMethodReturnTypeExtension

This is the interface dynamic return type extensions implement for non-static methods.

DynamicMethodSideEffectsExtension

This is the interface dynamic side effects extensions implement for methods. They describe the side effects of one call, without the effects of the callables passed to the parameters flagged with @pure-unless-callable-is-impure.

DynamicMethodThrowTypeExtension

This is the interface dynamic throw type extensions implement for non-static methods.

DynamicStaticMethodReturnTypeExtension

This is the interface dynamic return type extensions implement for static methods.

DynamicStaticMethodSideEffectsExtension

This is the interface dynamic side effects extensions implement for static methods. They describe the side effects of one call, without the effects of the callables passed to the parameters flagged with @pure-unless-callable-is-impure. An instantiation is asked about as a static call to __construct.

DynamicStaticMethodThrowTypeExtension

This is the interface dynamic throw type extensions implement for static methods.

ExpressionTypeResolverExtension

To register it in the configuration file use the phpstan.broker.expressionTypeResolverExtension service tag:

FunctionParameterClosureThisExtension

This is the interface for dynamically specifying the $this context for closure parameters in function calls.

FunctionParameterClosureTypeExtension

This is the interface for parameter closure type extensions for functions.

FunctionParameterOutTypeExtension

This is the interface dynamic parameter out type extensions implement for functions.

FunctionTypeSpecifyingExtension

This is the interface type-specifying extensions implement for functions.

LateResolvableType
MethodParameterClosureThisExtension

This is the interface for dynamically specifying the $this context for closure parameters in method calls.

MethodParameterClosureTypeExtension

This is the interface for parameter closure type extensions for methods.

MethodParameterOutTypeExtension

This is the interface dynamic parameter out type extensions implement for non-static methods.

MethodTypeSpecifyingExtension

This is the interface type-specifying extensions implement for non-static methods.

OperatorTypeSpecifyingExtension

This is the extension interface to implement if you want to describe how arithmetic operators like +, -, *, ^, / should infer types for PHP extensions that overload the behaviour, like GMP.

StaticMethodParameterClosureThisExtension

This is the interface for dynamically specifying the $this context for closure parameters in static method calls.

StaticMethodParameterClosureTypeExtension

This is the interface for parameter closure type extensions for static methods.

StaticMethodParameterOutTypeExtension

This is the interface dynamic parameter out type extensions implement for static methods.

StaticMethodTypeSpecifyingExtension

This is the interface type-specifying extensions implement for static methods.

Type

Represents a PHPStan type in the type system.

TypeTraverserCallable
TypeWithClassName

A Type that represents an object with a known class name.

UnaryOperatorTypeSpecifyingExtension

This is the extension interface to implement if you want to describe how unary operators like -, +, ~ should infer types for PHP extensions that overload the behaviour, like GMP.

Namespaces
PHPStan\Type\Accessory
PHPStan\Type\Constant
PHPStan\Type\Enum
PHPStan\Type\Generic
PHPStan\Type\Helper
PHPStan\Type\Php
PHPStan\Type\Traits