src/Helper.php
public static function class_uses_recursive($class)
    {
        if (\is_object($class)) {
            $class = \get_class($class);
        }

        $results = [];

        foreach (array_reverse(class_parents($class)) + [$class => $class] as $class) {
            $results += self::trait_uses_recursive($class);
        }

        return array_unique($results);
    }
public static function class_uses_recursive($class)
    {
        if (\is_object($class)) {
            $class = \get_class($class);
        }

        $results = [];

        foreach (array_reverse(class_parents($class)) + [$class => $class] as $class) {
            $results += self::trait_uses_recursive($class);
        }

        return array_unique($results);
    }
public static function class_uses_recursive ( $ class ) { if ( \ is_object ( $ class ) ) { $ class = \ get_class ( $ class ) ; } $ results = [ ] ; foreach ( array_reverse ( class_parents ( $ class ) ) + [ $ class => $ class ] as $ class ) { $ results += self :: trait_uses_recursive ( $ class ) ; } return array_unique ( $ results ) ; }
Returns all traits used by a class, its parent classes and trait of their traits.

@param  object|string  $class
@return array
Returns all traits used by a class its parent classes and trait of their traits .