final |
|---|
Where a native PHP type declaration is written, and for which PHP version.
Passed to Type::toNativePhpTypeNode(). Instead of exposing the position itself, it answers what the position allows, e.g. isCallableAllowed() is false for properties and class constants, and isNullAllowed() is false for a standalone type before PHP 8.2.
Compound types pass a derived position to their members: toUnionMember() for each
member of A|B, toNullableInner() for A in ?A, toIntersectionMember() for each
member of A&B. That is how e.g. an intersection type knows it can only be part
of a union (DNF) since PHP 8.2.
$type->toNativePhpTypeNode(NativeTypePosition::returnType(new PhpVersion(80100)));
| Methods | ||
|---|---|---|
public
static
|
parameter(PhpVersion $phpVersion): self
|
# |
public
static
|
returnType(PhpVersion $phpVersion): self
|
# |
public
static
|
property(PhpVersion $phpVersion): self
|
# |
public
static
|
classConstant(PhpVersion $phpVersion): self
|
# |
public
|
toUnionMember(): self
|
# |
public
|
toNullableInner(): self
|
# |
public
|
toIntersectionMember(): self
|
# |
public
|
isClassNameAllowed(): bool
|
# |
public
|
isScalarAllowed(): bool
|
# |
public
|
isArrayAllowed(): bool
|
# |
public
|
isIterableAllowed(): bool
|
# |
public
|
isCallableAllowed(): bool
|
# |
public
|
isObjectAllowed(): bool
|
# |
public
|
isStaticAllowed(): bool
|
# |
public
|
isVoidAllowed(): bool
|
# |
public
|
isNeverAllowed(): bool
|
# |
public
|
isMixedAllowed(): bool
|
# |
public
|
isNullAllowed(): bool
|
# |
public
|
isFalseAllowed(): bool
|
# |
public
|
isTrueAllowed(): bool
|
# |
public
|
isNullableAllowed(): bool
|
# |
public
|
isUnionAllowed(): bool
|
# |
public
|
isIntersectionAllowed(): bool
|
# |