The
class_uses_recursive
function returns all traits used by a class, including traits used by all of its parent classes: