* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\VarDumper\Caster; /** * Represents a PHP class identifier. * * @author Nicolas Grekas
*/ class ClassStub extends ConstStub { /** * @param string A PHP identifier, e.g. a class, method, interface, etc. name * @param callable The callable targeted by the identifier when it is ambiguous or not a real PHP identifier */ public function __construct($identifier, $callable = null) { $this->value = $identifier; if (0 < $i = strrpos($identifier, '\\')) { $this->attr['ellipsis'] = strlen($identifier) - $i; $this->attr['ellipsis-type'] = 'class'; $this->attr['ellipsis-tail'] = 1; } try { if (null !== $callable) { if ($callable instanceof \Closure) { $r = new \ReflectionFunction($callable); } elseif (is_object($callable)) { $r = array($callable, '__invoke'); } elseif (is_array($callable)) { $r = $callable; } elseif (false !== $i = strpos($callable, '::')) { $r = array(substr($callable, 0, $i), substr($callable, 2 + $i)); } else { $r = new \ReflectionFunction($callable); } } elseif (0 < $i = strpos($identifier, '::') ?: strpos($identifier, '->')) { $r = array(substr($identifier, 0, $i), substr($identifier, 2 + $i)); } else { $r = new \ReflectionClass($identifier); } if (is_array($r)) { try { $r = new \ReflectionMethod($r[0], $r[1]); } catch (\ReflectionException $e) { $r = new \ReflectionClass($r[0]); } } } catch (\ReflectionException $e) { return; } if ($f = $r->getFileName()) { $this->attr['file'] = $f; $this->attr['line'] = $r->getStartLine(); } } public static function wrapCallable($callable) { if (is_object($callable) || !is_callable($callable)) { return $callable; } if (!is_array($callable)) { $callable = new static($callable); } elseif (is_string($callable[0])) { $callable[0] = new static($callable[0]); } else { $callable[1] = new static($callable[1], $callable); } return $callable; } } __halt_compiler();----SIGNATURE:----TDN3VTOqMwS3MGOz9JFddTI5qykCMuv6UaH5eMfA1Tv/ILTPN7tvzHcxXWkTfxa7pD34FY75XjUFonWubLZYGY2WtZEAtJIkDj61TrxpXmhPQQWb2ugXb35P/9G+7A4jLlLU57ZuryngArhoQygZpc/BCeAMgUhRmfROzY5zbqX2/rMuKxot6NVTVdOFIKcjvC/fAxv24/UJiyb7etO3m7q8lUdD+/gOtxVJNF4ItzIhbxY/9s7YMRpkXnSCxpLBpGDnc4CffaE01+LKakNFJOKL1pwI8LLx/VWpSi3CfpAZaMtsF7QERefLhFywo9WqsFgS0HJ9J+xlbiRjqCOPgg8E2mbPVMdxHdc3sOJuUcaxgFowua/IsPwpe7M8JKe9iXoiVggyjYbe3MNIg1W+1RMKpN6RZEhE2/E25chTNbOnSNaU/YhuPs2y3Wh7u+MO26VD8UunpI+kjrqEtgyMNS7tmn772qao0hLsE2To/6y6zTvmcBCFGEW+d2fAbSXK3nacn+vslaoarVBSqLpQ+U2Fnlq+OCEDe7Hfa6BTFoRgRKVM0aoRIGgqmGQCXQhDXcO23O90HkHcO7Ks2hDx6TzjPqiREsWIOUAVvmmqOSQ4Q9I1naKeUTWn9g0gIyNk/rj3rDV/ZV0xDAw4QmrLi+63wlA+V0FLKAdYrGxgbxA=----ATTACHMENT:----MjUxNTY4OTE1Njg0Mzg1IDQ5ODgyODA3Mzk1NzA3MDIgNzY2NjY0MDg0NzM5NjgxOA==