private static function ClassCollectionLoader::getTraits

1 call to ClassCollectionLoader::getTraits()
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 306

Class

ClassCollectionLoader
ClassCollectionLoader.

Namespace

Symfony\Component\ClassLoader

Code

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