class ModelFactoryType extends ObjectType

Methods

__construct(string $className, Type|null $subtractedType = null, ClassReflection|null $classReflection = null, TrinaryLogic|null $isSingleModel = null)

Create a model factory type.

TrinaryLogic
isSingleModel()

Determine whether the factory makes a single model rather than a collection.

withSingleModel(TrinaryLogic $isSingleModel)

Get the same factory with the given count.

IsSuperTypeOfResult
isSuperTypeOf(Type $type)

Determine whether the type is a supertype of the given type.

bool
equals(Type $type)

Determine whether the type equals the given type, including its count.

string
describeAdditionalCacheKey()

Get the count, which keeps PHPStan's cached comparisons apart for factories whose counts differ.

Details

at line 21
__construct(string $className, Type|null $subtractedType = null, ClassReflection|null $classReflection = null, TrinaryLogic|null $isSingleModel = null)

Create a model factory type.

Parameters

string $className
Type|null $subtractedType
ClassReflection|null $classReflection
TrinaryLogic|null $isSingleModel

at line 35
TrinaryLogic isSingleModel()

Determine whether the factory makes a single model rather than a collection.

Return Value

TrinaryLogic

at line 43
ModelFactoryType withSingleModel(TrinaryLogic $isSingleModel)

Get the same factory with the given count.

Parameters

TrinaryLogic $isSingleModel

Return Value

ModelFactoryType

at line 54
IsSuperTypeOfResult isSuperTypeOf(Type $type)

Determine whether the type is a supertype of the given type.

Unlike upstream, a known count covers another factory only when that factory is known to have the same count, so merging branches whose counts differ keeps them apart instead of keeping whichever came first.

Parameters

Type $type

Return Value

IsSuperTypeOfResult

at line 70
bool equals(Type $type)

Determine whether the type equals the given type, including its count.

Parameters

Type $type

Return Value

bool

at line 78
protected string describeAdditionalCacheKey()

Get the count, which keeps PHPStan's cached comparisons apart for factories whose counts differ.

Return Value

string