private static function ClassCollectionLoader::computeTraitDeps

1 call to ClassCollectionLoader::computeTraitDeps()
ClassCollectionLoader::getClassHierarchy in drupal/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/ClassCollectionLoader.php

File

drupal/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/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;
}