PocketMine-MP 5.19.1 git-5cc1068cd43264d3363295eb8d6901e02f467897
|
Public Member Functions | |
__construct ($parameterName, $typeName=null, $flags=self::CONTRAVARIANT) | |
__toString () | |
isSatisfiedBy ($typeName, $nullable, $byReference) | |
Static Public Member Functions | |
static | createFromReflectionParameter ($reflection, $flags=0) |
Public Attributes | |
$allowsContravariance | |
$allowsCovariance | |
$isByReference | |
$isNullable | |
$isOptional | |
$isVariadic | |
$isWeak | |
$typeName | |
const | CONTRAVARIANT = 0x01 << 8 |
const | COVARIANT = 0x02 << 8 |
const | NULLABLE = 0x02 |
const | OPTIONAL = 0x08 << 8 |
const | REFERENCE = 0x04 |
const | VARIADIC = 0x04 << 8 |
const | WEAK = 0x01 |
Definition at line 5 of file ParameterType.php.
DaveRandom\CallbackValidator\ParameterType::__construct | ( | $parameterName, | |
$typeName = null , |
|||
$flags = self::CONTRAVARIANT |
|||
) |
string | $parameterName | |
string | null | $typeName | |
int | $flags |
Definition at line 93 of file ParameterType.php.
DaveRandom\CallbackValidator\ParameterType::__toString | ( | ) |
Definition at line 107 of file ParameterType.php.
|
static |
Create a new ParameterType instance from a \ReflectionParameter instance
\ReflectionParameter | $reflection | |
int | $flags |
Definition at line 56 of file ParameterType.php.
References DaveRandom\CallbackValidator\Type\NULLABLE, DaveRandom\CallbackValidator\ParameterType\OPTIONAL, DaveRandom\CallbackValidator\Type\REFERENCE, and DaveRandom\CallbackValidator\ParameterType\VARIADIC.
Referenced by DaveRandom\CallbackValidator\CallbackType\createFromCallable().
|
inherited |
Whether the type will be satisfied by the specified type name, nullability and by-reference combination
string | null | $typeName | |
bool | $nullable | |
bool | $byReference |
Definition at line 91 of file Type.php.
References DaveRandom\CallbackValidator\MatchTester\isMatch(), and DaveRandom\CallbackValidator\MatchTester\isWeakScalarMatch().
|
inherited |
|
inherited |
DaveRandom\CallbackValidator\ParameterType::$isOptional |
Definition at line 47 of file ParameterType.php.
DaveRandom\CallbackValidator\ParameterType::$isVariadic |
Definition at line 40 of file ParameterType.php.
const DaveRandom\CallbackValidator\ParameterType::CONTRAVARIANT = 0x01 << 8 |
Contravariant parameters allow implementors to specify a supertype of that which is specified in the prototype
Definition at line 10 of file ParameterType.php.
const DaveRandom\CallbackValidator\ParameterType::COVARIANT = 0x02 << 8 |
Covariant parameters allow implementors to specify a subtype of that which is specified in the prototype Usually this isn't a good idea, it's not type-safe, do not use unless you understand what you are doing!
Definition at line 16 of file ParameterType.php.
|
inherited |
Nullable types are either explicitly ?type (PHP>=7.1) or with a default value of null
Definition at line 15 of file Type.php.
Referenced by DaveRandom\CallbackValidator\ReturnType\createFromReflectionFunctionAbstract(), and DaveRandom\CallbackValidator\ParameterType\createFromReflectionParameter().
const DaveRandom\CallbackValidator\ParameterType::OPTIONAL = 0x08 << 8 |
An optional parameter may be omitted at call time
Definition at line 26 of file ParameterType.php.
Referenced by DaveRandom\CallbackValidator\ParameterType\createFromReflectionParameter().
|
inherited |
Reference types must always match
Definition at line 20 of file Type.php.
Referenced by DaveRandom\CallbackValidator\ReturnType\createFromReflectionFunctionAbstract(), and DaveRandom\CallbackValidator\ParameterType\createFromReflectionParameter().
const DaveRandom\CallbackValidator\ParameterType::VARIADIC = 0x04 << 8 |
A variadic parameter accepts zero or more arguments of the specified type
Definition at line 21 of file ParameterType.php.
Referenced by DaveRandom\CallbackValidator\ParameterType\createFromReflectionParameter().
|
inherited |