yuyat/callable_to_reflector

Transforms any callable into Reflector

v0.9.0 2014-10-13 14:19 UTC

This package is auto-updated.

Last update: 2024-10-25 21:23:43 UTC


README

Transforms any callable value into Reflector.

Usage

<?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

Author

Yuya Takeyama