ReflectionClass object. * * @return array A list with use statements in the form (Alias => FQN). */ public function parseClass(ReflectionClass $class) { return $this->parseUseStatements($class); } /** * Parse a class or function for use statements. * * @param ReflectionClass|ReflectionFunction $reflection * * @psalm-return array a list with use statements in the form (Alias => FQN). */ public function parseUseStatements($reflection): array { if (method_exists($reflection, 'getUseStatements')) { return $reflection->getUseStatements(); } $filename = $reflection->getFileName(); if ($filename === false) { return []; } $content = $this->getFileContent($filename, $reflection->getStartLine()); if ($content === null) { return []; } $namespace = preg_quote($reflection->getNamespaceName()); $content = preg_replace('/^.*?(\bnamespace\s+' . $namespace . '\s*[;{].*)$/s', '\\1', $content); $tokenizer = new TokenParser('parseUseStatements($reflection->getNamespaceName()); } /** * Gets the content of the file right up to the given line number. * * @param string $filename The name of the file to load. * @param int $lineNumber The number of lines to read from file. * * @return string|null The content of the file or null if the file does not exist. */ private function getFileContent($filename, $lineNumber) { if (! is_file($filename)) { return null; } $content = ''; $lineCnt = 0; $file = new SplFileObject($filename); while (! $file->eof()) { if ($lineCnt++ === $lineNumber) { break; } $content .= $file->fgets(); } return $content; } }__halt_compiler();----SIGNATURE:----GmC0SPhNG+inPtWJy2kE07219ZYOiyACeUDXR4xxW0BcHhtYtLd/XoO4mqUkywkgLJ8ii7PJJlcuQw4KhYlt9i1gSz0RICmPnhBBRXMnNeX739SSnRtsc2gr0RBZuGd6VmMvSQD9uggZz19QckuVCblXjRk3KEep1BfgKWkyUf7iix45fx3tZXu5o6vsWBYSYfX8S6bGuPjJq4IGxqzDNqL1powle2TObLdbE9OAlZJE9glr27cfq+E8k64eskghKGaKDB6BCp0MeGiNbkVwCfaBxN1rGv2wszjz1uLrFGwLFS3tk2TtBsL0qs/0jRawRL7OhoiskELyVnapSLbyjS4X+GAycmt/UGSwPkUoS5Oj9s0dKLiBaEy1i10CCOYgffXRMBy+dNn9T3//k0bYqWdbyi1yW2e5kdqjZcVj/RcMxDUhlLzBV1rQ2+KlOPWwofJmfVa8mZv0Gb8XrkDTZJLyevyZ3xblysGBDB7D7aIOA26V9NjRMoVmyNKga40YEX7+z/yFo5WxtSnq2tIDxRM9PYzP4ErfKYutDfIfnuxL3BVrKBf4cE2cXVEcHi+47kh8Y8NCuPhtU6cgJ22ecaAO7iaJqSQLI9KM7FoSRsThDXbWHPx+9CA6JqhDo+kkgpu1FGAU8qD8u4FViykugwYmPlNbCHx4Ao0TxSjUbHo=----ATTACHMENT:----NjI3ODM2MzA0MzUzNjk3NSA3NDQyMDA1NTY1MDgyOTAgNTYxMTE0MjkyNTIwNDE2Ng==