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-04-25 20:18:57 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