Fast Forward Deferred Callbacks utility classes

CallbackDescriber
in package

FinalYes

This utility class MUST be used to generate human-readable descriptions for any PHP callable.

It SHALL support closures, array callables, invokable objects, and string callables. All methods MUST be static and MUST NOT throw exceptions.

Table of Contents

Methods

describe()  : string
Returns a human-readable description for a callable.
describeArrayCallable()  : string
Returns a description for an array callable.
describeClosure()  : string
Returns a description for a Closure, including file and line if available.

Methods

describe()

Returns a human-readable description for a callable.

public static describe(callable $callback) : string

This method MUST support closures, array callables, invokable objects, and string callables.

Parameters
$callback : callable

the callable to describe

Return values
string

the description of the callable

describeArrayCallable()

Returns a description for an array callable.

private static describeArrayCallable(array<string|int, mixed> $callback) : string
Parameters
$callback : array<string|int, mixed>
Return values
string

the description of the array callable

describeClosure()

Returns a description for a Closure, including file and line if available.

private static describeClosure(Closure $closure) : string
Parameters
$closure : Closure

the closure to describe

Return values
string

the description of the closure


        
On this page

Search results