getDependenciesByClass() public méthode

public getDependenciesByClass ( $klass ) : Dependency[]
$klass
Résultat SensioLabs\Deptrac\DependencyResult\Dependency[]
 public function testAddDependency()
 {
     $dependencyResult = new DependencyResult();
     $dependencyResult->addDependency($dep1 = new DependencyResult\Dependency('A', 12, 'B'));
     $dependencyResult->addDependency($dep2 = new DependencyResult\Dependency('B', 12, 'C'));
     $dependencyResult->addDependency($dep3 = new DependencyResult\Dependency('A', 12, 'C'));
     $this->assertSame([$dep1, $dep3], $dependencyResult->getDependenciesByClass('A'));
     $this->assertSame([$dep2], $dependencyResult->getDependenciesByClass('B'));
     $this->assertSame([], $dependencyResult->getDependenciesByClass('C'));
     $this->assertCount(3, $dependencyResult->getDependenciesAndInheritDependencies());
 }
 public function flattenDependencies(AstMap $astMap, DependencyResult $dependencyResult)
 {
     foreach ($astMap->getAstClassReferences() as $classReference) {
         foreach ($astMap->getClassInherits($classReference->getClassName()) as $inherit) {
             if (!$inherit instanceof FlattenAstInherit) {
                 continue;
             }
             foreach ($dependencyResult->getDependenciesByClass($inherit->getClassName()) as $dep) {
                 $dependencyResult->addInheritDependency(new InheritDependency($classReference->getClassName(), $dep->getClassB(), $dep, $inherit));
             }
         }
     }
 }