* * 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:----rvwsqdNT0Lar2GmJjWeZVRMgqIiI5nWgSZiEHgjVxvfp7rJv374/qH63Q2ujGgOLjSbh3toaKfMyo20DT70gQsv/mgg7nskpQ+jfdk5j9I7ohkk3Jn/I7/1fUubtOu98yUiEj1SSoSt7WdcQcCMcrWDzuZkVz4xd5qSjRoCSTeRNplOc39cB+6Y2n5mQAyR3Wp5m2/vcLsJF3V2JLWVeDi99lQqoWxGK4+Q/M3J8T2FY2Ej4tscirk41DuUaI7AcKJ5vgcQ7dRhMrR6+JDdZ4Eb5/MqZxnG0ef990LWXcemneK6rAwhDHJFWvVpa4DFiEqox/yevL78N+psMwiZDVRYtEeFWDdbgBOpnh4Fmm9hhI3j69AYugAPuIgsrqKKAL/WQspgRNokJ+DhMAIKaiwzqJ8Fs8v1rrj87bhML30jqfKxqd3lZB/fNWNvLMQ4um2tyQdsr1h7WmC5XUcWkGQ/q8jJYCDKucsw+wRiSORxgUInphxoZUSl+o0JccOmQg23JhyGfqBz/Ths0BiaDN1OBLVPO/57y/9V1Q9qkbVX6C4mNSVBtW8iFZPUa3I1JYrl6plY/ZFq9AFsB2mpMBCbJAQeUgeMbktq1PU9NEm+AzGnJlUZn+Wtmu0gPhl0kh2lJ9WN/2agZ4pKvUSJuV48Wio+fXwT074IEHOJKuPQ=----ATTACHMENT:----Nzg4ODk3MTI0ODgwNjYyNCAyOTI2NzI5NTkyODg3MDAyIDc0Mzg3NTE5NTM4NDY0MjA=