12 namespace fpoirotte\XRL;
51 throw new \InvalidArgumentException(
'Not a valid callable');
60 $this->callableObj = $callable;
82 if (version_compare(PHP_VERSION,
'5.4',
'>=')) {
85 $bt = debug_backtrace(0, 1);
86 } elseif (version_compare(PHP_VERSION,
'5.3.6',
'>=')) {
89 $bt = debug_backtrace(0);
91 $bt = debug_backtrace(
false);
94 if (isset($bt[0][
'args'])) {
95 $args =& $bt[0][
'args'];
99 return call_user_func_array($this->callableObj, $args);
105 return call_user_func_array($this->callableObj, $args);
114 if (version_compare(PHP_VERSION,
'5.4',
'>=')) {
117 $bt = debug_backtrace(0, 1);
118 } elseif (version_compare(PHP_VERSION,
'5.3.6',
'>=')) {
121 $bt = debug_backtrace(0);
123 $bt = debug_backtrace(
false);
126 if (isset($bt[0][
'args'])) {
127 $args =& $bt[0][
'args'];
131 return call_user_func(array($this,
'invokeArgs'), $args);
143 $parts = explode(
'::', $this->representation);
146 if (count($parts) == 1) {
147 return new \ReflectionFunction($this->callableObj);
151 if (!is_array($this->callableObj)) {
152 $callable = array($this->callableObj, $parts[1]);
156 return new \ReflectionMethod($callable[0], $callable[1]);
$callableObj
Inner callable object, as used by PHP.
Interface for something that can be called.
$representation
Human representation of the inner callable.
Class used to represent anything that is callable.