applyDependencies() public method

public applyDependencies ( SensioLabs\AstRunner\AstParser\AstParserInterface $astParser, SensioLabs\AstRunner\AstMap $astMap, DependencyResult $dependencyResult ) : mixed
$astParser SensioLabs\AstRunner\AstParser\AstParserInterface
$astMap SensioLabs\AstRunner\AstMap
$dependencyResult SensioLabs\Deptrac\DependencyResult
return mixed
Example #1
0
 public function getDeps(DependencyEmitterInterface $emitter, \SplFileInfo $fileInfo)
 {
     $parser = new NikicPhpParser();
     $astMap = (new AstRunner())->createAstMapByFiles($parser, new EventDispatcher(), [$fileInfo]);
     $result = new DependencyResult();
     $emitter->applyDependencies($parser, $astMap, $result);
     return array_map(function (Dependency $d) {
         return $d->getClassA() . ':' . $d->getClassALine() . ' on ' . $d->getClassB();
     }, $result->getDependenciesAndInheritDependencies());
 }