Callback
final class Callback
PHP callable tools.
Methods
Invokes internal PHP function with own error handler.
Checks that $callable is a valid PHP callback and returns it. With $syntax set to true, only verifies the structural validity without checking whether 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 mixed
invokeSafe(string $function, array $args, callable $onError)
Invokes internal PHP function with own error handler.
at line 57
static mixed
check(mixed $callable, bool $syntax = false)
Checks that $callable is a valid PHP callback and returns it. With $syntax set to true, only verifies the structural validity without checking whether the class or method actually exists.
at line 74
static string
toString(mixed $callable)
Converts PHP callback to textual form. Class or method may not exists.
at line 91
static ReflectionMethod|ReflectionFunction
toReflection(mixed $callable)
Returns reflection for method or function used in PHP callback.
at line 113
static bool
isStatic(callable $callable)
Checks whether PHP callback is function or static method.
at line 123
static callable|array|string
unwrap(Closure $closure)
Unwraps closure created by Closure::fromCallable().
Traits
Prevents instantiation.