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:----pAED1N6I2lQOpmwawzH+cfUMAhk7fSDJ6Q9/1oO0podBOj5YuwLlSUPa+9vPamMJBxLLYImDivNNOsi0x+ysXB4BV21Q+U7YoryBDTnADCGMJrQl5XuH6G9hMWtk6meCLb5b3Q3bD/eHmTo7Q9tv+5WYWpl99wHEqyHDZv2oS26vHuaHC2sYbTFTkdDibp3Xzi/A++E88kGzco5cTtLWZrHA7Dzi960vz/QNWSRVftpVmL5cEmu8C1brrhMk1OE8Hejd3WLbR+HGL1ITWERV0dyG6EG5Tc2QyCQ0/YxUrlgMWLFC07gOlEho6eUVp0huEmFJVTUfkl2dSJGloORDiLy8PteEgYCsRB51FltShmBSPPpp5ynp2yKafojEnaCwyBmAPfo0FF5SgHnXFYw7v6SQabBCBMnaEiVblLKPoNAAWLlgCt8s5bGc2tbCh5GduJzUpXt0kRP4sU7c522TSmjEiBmIgcMrB7WVsFU0SGHliGxoeCPauzSak/nmaXxg22FMyai2d+UHlImxP6Bk+tq+Jrn9Kkf+BibezLlOJ25uAoHhhtgSWqPYPwJmbD9bfOBhgZ9wpzXce+oRNgnx8lQFlqyuO4GKom6M9B9MD8UxWNByE0vgt5ogYqsXEFj/IcAVfN2mZ1FJ4+sgYtCICcwrFMc+JkeDxmWQthunwBg=----ATTACHMENT:----MzY4MTAyNzI4ODE4ODY2IDk5MzQ0MDU3NDM4MjA4MTYgMTgwODg0MDA0MzkwNDUxNw==