Callback
final class Callback
PHP callable tools.
Methods
Invokes internal PHP function with own error handler.
Checks that $callable is valid PHP callback. Otherwise throws exception. If the $syntax is set to true, only verifies that $callable has a valid structure to be used as a callback, but does not verify if the class or method actually exists.
Converts PHP callback to textual form. Class or method may not exists.
Returns reflection for method or function used in PHP callback.
Checks whether PHP callback is function or static method.
Details
at line 27
static Closure
closure(string|object|callable $callable, string $method = null)
deprecated
deprecated
No description
at line 43
static mixed
invoke($callable, ...$args)
deprecated
deprecated
Invokes callback.
at line 56
static mixed
invokeArgs($callable, array $args = [])
deprecated
deprecated
Invokes callback with an array of parameters.
at line 68
static mixed
invokeSafe(string $function, array $args, callable $onError)
Invokes internal PHP function with own error handler.
at line 98
static callable
check(mixed $callable, bool $syntax = false)
Checks that $callable is valid PHP callback. Otherwise throws exception. If the $syntax is set to true, only verifies that $callable has a valid structure to be used as a callback, but does not verify if the class or method actually exists.
at line 115
static string
toString(mixed $callable)
Converts PHP callback to textual form. Class or method may not exists.
at line 135
static ReflectionFunctionAbstract
toReflection(callable $callable)
Returns reflection for method or function used in PHP callback.
at line 156
static bool
isStatic(callable $callable)
Checks whether PHP callback is function or static method.
at line 166
static callable|array
unwrap(Closure $closure)
Unwraps closure created by Closure::fromCallable().
Traits
Static class.