CallbackType
in package
Table of Contents
- $parameters : array<string|int, ParameterType>
- $returnType : ReturnType
- __construct() : mixed
- __toString() : string
- createFromCallable() : CallbackType
- isSatisfiedBy() : bool
- reflectCallable() : ReflectionFunction|ReflectionMethod
- Given a callable, create the appropriate reflection
Properties
$parameters
private
array<string|int, ParameterType>
$parameters
$returnType
private
ReturnType
$returnType
Methods
__construct()
public
__construct(ReturnType $returnType, ParameterType ...$parameters) : mixed
Parameters
- $returnType : ReturnType
- $parameters : ParameterType
Return values
mixed —__toString()
public
__toString() : string
Return values
string —createFromCallable()
public
static createFromCallable(callable $callable[, int $flags = ParameterType::CONTRAVARIANT | ReturnType::COVARIANT ]) : CallbackType
Parameters
- $callable : callable
- $flags : int = ParameterType::CONTRAVARIANT | ReturnType::COVARIANT
Tags
Return values
CallbackType —isSatisfiedBy()
public
isSatisfiedBy(callable $callable) : bool
Parameters
- $callable : callable
Return values
bool —reflectCallable()
Given a callable, create the appropriate reflection
private
static reflectCallable(callable $target) : ReflectionFunction|ReflectionMethod
This will accept things the PHP would fail to invoke due to scoping, but we can reflect them anyway. Do not add a callable type-hint or this behaviour will break!
Parameters
- $target : callable