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;
}