You are here

private static function ClassCollectionLoader::computeTraitDeps in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/class-loader/ClassCollectionLoader.php \Symfony\Component\ClassLoader\ClassCollectionLoader::computeTraitDeps()
1 call to ClassCollectionLoader::computeTraitDeps()
ClassCollectionLoader::getClassHierarchy in vendor/symfony/class-loader/ClassCollectionLoader.php

File

vendor/symfony/class-loader/ClassCollectionLoader.php, line 316

Class

ClassCollectionLoader
ClassCollectionLoader.

Namespace

Symfony\Component\ClassLoader

Code

private static function computeTraitDeps(\ReflectionClass $class) {
  $traits = $class
    ->getTraits();
  $deps = array(
    $class
      ->getName() => $traits,
  );
  while ($trait = array_pop($traits)) {
    if ($trait
      ->isUserDefined() && !isset(self::$seen[$trait
      ->getName()])) {
      self::$seen[$trait
        ->getName()] = true;
      $traitDeps = $trait
        ->getTraits();
      $deps[$trait
        ->getName()] = $traitDeps;
      $traits = array_merge($traits, $traitDeps);
    }
  }
  return $deps;
}