This function will output an array containing all traits used by the given class and its ascendance, and all the traits they use themselves, etc.

function getRecursiveTraits($class)
{
    $reflection = new \ReflectionClass($class);
    $traits = array_keys($reflection->getTraits());

    foreach ($traits as $trait) {
        $traits = array_merge($traits, getRecursiveTraits($trait));
    }

    if ($parent = $reflection->getParentClass()) {
        $traits = array_merge($traits, static::getRecursiveTraits($parent->getName()));
    }

    return $traits;
}