yuyat / callable_to_reflector
将任何可调用对象转换为 Reflector
v0.9.0
2014-10-13 14:19 UTC
Requires
- php: >=5.3
Requires (Dev)
- phpunit/phpunit: ~4.2
This package is auto-updated.
Last update: 2024-08-25 20:55:47 UTC
README
将任何 callable
值转换为 Reflector
。
用法
<?php use function callableToReflector; $reflector = callableToReflector(function ($x) { return $x; }); // => ReflectionFunction $reflector = callableToReflector('func'); // => ReflectionFunction $reflector = callableToReflector([$obj, 'method']); // => ReflectionMethod $reflector = callableToReflector(['Klass', 'method']); // => ReflectionMethod $reflector = callableToReflector($invokableObj); // => ReflectionMethod $reflector = callableToReflector('Klass::method'); // => ReflectionMethod
作者
Yuya Takeyama