public function analyze(string $path)
    {
        $contents = (string) file_get_contents($path);

        $traverser = new NodeTraverser();

        $traverser->addVisitor(new NameResolver());
        $traverser->addVisitor($imports = new ImportVisitor());
        $traverser->addVisitor($names = new NameVisitor());
        $traverser->addVisitor($docs = DocVisitor::create($contents));

        $traverser->traverse($this->parser->parse($contents));

        return array_values(array_unique(array_merge(
            $imports->getImports(),
            $names->getNames(),
            DocProcessor::process($docs->getDoc())
        )));
    }
public function analyze(string $path)
    {
        $contents = (string) file_get_contents($path);

        $traverser = new NodeTraverser();

        $traverser->addVisitor(new NameResolver());
        $traverser->addVisitor($imports = new ImportVisitor());
        $traverser->addVisitor($names = new NameVisitor());
        $traverser->addVisitor($docs = DocVisitor::create($contents));

        $traverser->traverse($this->parser->parse($contents));

        return array_values(array_unique(array_merge(
            $imports->getImports(),
            $names->getNames(),
            DocProcessor::process($docs->getDoc())
        )));
    }
public function analyze ( string $ path ) { $ contents = ( string ) file_get_contents ( $ path ) ; $ traverser = new NodeTraverser ( ) ; $ traverser -> addVisitor ( new NameResolver ( ) ) ; $ traverser -> addVisitor ( $ imports = new ImportVisitor ( ) ) ; $ traverser -> addVisitor ( $ names = new NameVisitor ( ) ) ; $ traverser -> addVisitor ( $ docs = DocVisitor :: create ( $ contents ) ) ; $ traverser -> traverse ( $ this -> parser -> parse ( $ contents ) ) ; return array_values ( array_unique ( array_merge ( $ imports -> getImports ( ) , $ names -> getNames ( ) , DocProcessor :: process ( $ docs -> getDoc ( ) ) ) ) ) ; }
Get the fullyqualified imports and typehints.

@param string $path

@return string[]
Get the fullyqualified imports and typehints .