get all traits of ancestor classes & ancestor traits

useful when using setters in traits
Not saying you should rewrite it, but I think this could also be constructed as:

```php
while ($trait = next($traits)) {
  foreach (...)
}
```

Which avoids the `list()` and unused `$i` variable.