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