dkx / callable-parser
This package is abandoned and no longer maintained.
No replacement package was suggested.
Callable parser
0.0.1
2019-02-03 12:30 UTC
Requires
- php: ^7.2
Requires (Dev)
- phpunit/phpunit: ^8.0
This package is auto-updated.
Last update: 2024-01-29 02:38:34 UTC
README
Callable parser
Installation
$ composer require dkx/callable-parser
Usage
<?php
namespace DKX\CallableParser\CallableParser;
$callable = getCallableSomehow();
$parsed = CallableParser::parse($callable);
The parse()
method can return one of the following classes:
DKX\CallableParser\Callables\FunctionCallable
: passed function nameDKX\CallableParser\Callables\MethodCallCallable
: passed instantiated object and method name (in array)DKX\CallableParser\Callables\StaticMethodCallCallable
: passed either string withclassName::methodName
notation or array with class name and method nameDKX\CallableParser\Callables\AnonymousFunctionCallable
: passed anonymous function