final class Callback

PHP callable tools.

Methods

static Closure
closure(string|object|callable $callable, string $method = null) deprecated

No description

static mixed
invoke($callable, ...$args) deprecated

Invokes callback.

static mixed
invokeArgs($callable, array $args = []) deprecated

Invokes callback with an array of parameters.

static mixed
invokeSafe(string $function, array $args, callable $onError)

Invokes internal PHP function with own error handler.

static callable
check($callable, bool $syntax = false)

No description

static string
toString($callable)

No description

toReflection($callable)

No description

static bool
isStatic(callable $callable)

No description

static callable
unwrap(Closure $closure)

Unwraps closure created by Closure::fromCallable()

Details

at line 27
static Closure closure(string|object|callable $callable, string $method = null) deprecated

deprecated use Closure::fromCallable()

No description

Parameters

string|object|callable $callable

class, object, callable

string $method

Return Value

Closure

at line 42
static mixed invoke($callable, ...$args) deprecated

deprecated

Invokes callback.

Parameters

$callable
...$args

Return Value

mixed

at line 55
static mixed invokeArgs($callable, array $args = []) deprecated

deprecated

Invokes callback with an array of parameters.

Parameters

$callable
array $args

Return Value

mixed

at line 67
static mixed invokeSafe(string $function, array $args, callable $onError)

Invokes internal PHP function with own error handler.

Parameters

string $function
array $args
callable $onError

Return Value

mixed

at line 94
static callable check($callable, bool $syntax = false)

No description

Parameters

$callable
bool $syntax

Return Value

callable

at line 106
static string toString($callable)

No description

Parameters

$callable

Return Value

string

at line 120
static ReflectionFunctionAbstract toReflection($callable)

No description

Parameters

$callable

Return Value

ReflectionFunctionAbstract

at line 138
static bool isStatic(callable $callable)

No description

Parameters

callable $callable

Return Value

bool

at line 148
static callable unwrap(Closure $closure)

internal  
 

Unwraps closure created by Closure::fromCallable()

Parameters

Closure $closure

Return Value

callable

Traits

Static class.