Type
in package
Table of Contents
- NULLABLE = 0x2
- Nullable types are either explicitly ?type (PHP>=7.1) or with a default value of null
- REFERENCE = 0x4
- Reference types must always match
- WEAK = 0x1
- Weak mode validates types using the same rules are strict_types=0
- $allowsContravariance : bool
- Whether the type allows contravariant matches
- $allowsCovariance : bool
- Whether the type allows covariant matches
- $isByReference : bool
- Whether the type is passed by reference
- $isNullable : bool
- Whether the type is nullable
- $isWeak : bool
- Whether the type should be matched in weak mode
- $typeName : string|null
- The name of the type
- isSatisfiedBy() : bool
- Whether the type will be satisfied by the specified type name, nullability and by-reference combination
- __construct() : mixed
Constants
NULLABLE
Nullable types are either explicitly ?type (PHP>=7.1) or with a default value of null
public
mixed
NULLABLE
= 0x2
REFERENCE
Reference types must always match
public
mixed
REFERENCE
= 0x4
WEAK
Weak mode validates types using the same rules are strict_types=0
public
mixed
WEAK
= 0x1
Properties
$allowsContravariance
Whether the type allows contravariant matches
public
bool
$allowsContravariance
$allowsCovariance
Whether the type allows covariant matches
public
bool
$allowsCovariance
$isByReference
Whether the type is passed by reference
public
bool
$isByReference
$isNullable
Whether the type is nullable
public
bool
$isNullable
$isWeak
Whether the type should be matched in weak mode
public
bool
$isWeak
$typeName
The name of the type
public
string|null
$typeName
Methods
isSatisfiedBy()
Whether the type will be satisfied by the specified type name, nullability and by-reference combination
public
isSatisfiedBy(string|null $typeName, bool $nullable, bool $byReference) : bool
Parameters
- $typeName : string|null
- $nullable : bool
- $byReference : bool
Return values
bool —__construct()
protected
__construct(string|null $typeName, int $flags, bool $allowsCovariance, bool $allowsContravariance) : mixed
Parameters
- $typeName : string|null
- $flags : int
- $allowsCovariance : bool
- $allowsContravariance : bool