| Methods |
public
|
__construct(string $value, bool $isClassString = false)
|
#
|
public
|
getValue(): string
|
#
|
public
|
getConstantStrings(): array
|
#
|
public
|
isClassString(): TrinaryLogic
|
#
|
public
|
getClassStringObjectType(): Type
Returns the object type for a class-string or literal class name string.
For non-class-string types, returns ErrorType.
Returns the object type for a class-string or literal class name string.
For non-class-string types, returns ErrorType.
Overrides
Implements
|
#
|
public
|
getObjectTypeOrClassStringObjectType(): Type
Like getClassStringObjectType(), but also returns object types as-is.
Used for $classOrObject::method() where the left side can be either.
Like getClassStringObjectType(), but also returns object types as-is.
Used for $classOrObject::method() where the left side can be either.
Overrides
Implements
|
#
|
public
|
describe(VerbosityLevel $level): string
|
#
|
public
|
isSuperTypeOf(Type $type): IsSuperTypeOfResult
"Does every value of $type belong to $this type?" Preferable to instanceof checks because it correctly handles
union types, intersection types, and all other composite types.
"Does every value of $type belong to $this type?" Preferable to instanceof checks because it correctly handles
union types, intersection types, and all other composite types.
Implements
|
#
|
public
|
isCallable(): TrinaryLogic
|
#
|
public
|
getCallableParametersAcceptors(ClassMemberAccessAnswerer $scope): array
|
#
|
public
|
toNumber(): Type
Models numeric coercion for arithmetic operators.
Models numeric coercion for arithmetic operators.
Overrides
Implements
|
#
|
public
|
toAbsoluteNumber(): Type
|
#
|
public
|
toInteger(): Type
|
#
|
public
|
toFloat(): Type
|
#
|
public
|
toArrayKey(): Type
Models PHP's implicit array key coercion: floats truncated to int,
booleans become 0/1, null becomes '', numeric strings become int.
Models PHP's implicit array key coercion: floats truncated to int,
booleans become 0/1, null becomes '', numeric strings become int.
Overrides
Implements
|
#
|
public
|
isString(): TrinaryLogic
|
#
|
public
|
isNumericString(): TrinaryLogic
|
#
|
public
|
isNonEmptyString(): TrinaryLogic
|
#
|
public
|
isNonFalsyString(): TrinaryLogic
Non-falsy string is a non-empty string that is also not '0'.
Stricter subset of non-empty-string.
Non-falsy string is a non-empty string that is also not '0'.
Stricter subset of non-empty-string.
Overrides
Implements
|
#
|
public
|
isLiteralString(): TrinaryLogic
A literal-string is a string composed entirely from string literals
in the source code (not from user input). Used for SQL injection prevention.
A literal-string is a string composed entirely from string literals
in the source code (not from user input). Used for SQL injection prevention.
Overrides
Implements
|
#
|
public
|
isLowercaseString(): TrinaryLogic
|
#
|
public
|
isUppercaseString(): TrinaryLogic
|
#
|
public
|
hasOffsetValueType(Type $offsetType): TrinaryLogic
|
#
|
public
|
getOffsetValueType(Type $offsetType): Type
|
#
|
public
|
setOffsetValueType(?Type $offsetType, Type $valueType, bool $unionValues = true): Type
May add a new key. When $offsetType is null, appends (like $a[] = $value).
May add a new key. When $offsetType is null, appends (like $a[] = $value).
Overrides
Implements
|
#
|
public
|
setExistingOffsetValueType(Type $offsetType, Type $valueType): Type
Unlike setOffsetValueType(), assumes the key already exists.
Preserves the array shape and list type.
Unlike setOffsetValueType(), assumes the key already exists.
Preserves the array shape and list type.
Overrides
Implements
|
#
|
public
|
append(self $otherString): self
|
#
|
public
|
generalize(GeneralizePrecision $precision): Type
Removes constant value information. E.g. 'foo' -> string, 1 -> int.
Used when types become too complex to track precisely (e.g. loop iterations).
Removes constant value information. E.g. 'foo' -> string, 1 -> int.
Used when types become too complex to track precisely (e.g. loop iterations).
Implements
|
#
|
public
|
getSmallerType(PhpVersion $phpVersion): Type
Type narrowing methods for comparison operators.
For example, for ConstantIntegerType(5), getSmallerType() returns int<min, 4>.
Type narrowing methods for comparison operators.
For example, for ConstantIntegerType(5), getSmallerType() returns int<min, 4>.
Implements
|
#
|
public
|
getSmallerOrEqualType(PhpVersion $phpVersion): Type
|
#
|
public
|
getGreaterType(PhpVersion $phpVersion): Type
|
#
|
public
|
getGreaterOrEqualType(PhpVersion $phpVersion): Type
|
#
|
public
|
canAccessConstants(): TrinaryLogic
|
#
|
public
|
hasConstant(string $constantName): TrinaryLogic
|
#
|
public
|
getConstant(string $constantName): ClassConstantReflection
|
#
|
public
|
toPhpDocNode(): TypeNode
|
#
|