ModelFactoryType
class ModelFactoryType extends ObjectType
Methods
Create a model factory type.
Determine whether the factory makes a single model rather than a collection.
Get the same factory with the given count.
Determine whether the type is a supertype of the given type.
Determine whether the type equals the given type, including its count.
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.
at line 35
TrinaryLogic
isSingleModel()
Determine whether the factory makes a single model rather than a collection.
at line 43
ModelFactoryType
withSingleModel(TrinaryLogic $isSingleModel)
Get the same factory with the given count.
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.
at line 70
bool
equals(Type $type)
Determine whether the type equals the given type, including its count.
at line 78
protected string
describeAdditionalCacheKey()
Get the count, which keeps PHPStan's cached comparisons apart for factories whose counts differ.