class CallableElement

Methods

__construct(callable $callable)

No description

int
countArguments()

No description

bool
hasReturnType(string $type)

Determines if the callable has an explicit return type and that return type matches the specified type.

string
getReturnType()

Gets the return type of the callable.

Details

at line 20
__construct(callable $callable)

No description

Parameters

callable $callable

Exceptions

ReflectionException

at line 71
int countArguments()

No description

Return Value

int

at line 82
bool hasReturnType(string $type)

Determines if the callable has an explicit return type and that return type matches the specified type.

Closure, arrow functions MUST declare explicitly the return type in the signature to be able to detect it. It will always be false if not.

Parameters

string $type

Return Value

bool

at line 96
string getReturnType()

Gets the return type of the callable.

Return Value

string

Exceptions

InvalidArgumentException