Break this line up into three, as right now, it's getting unreadable:

```php
$class = substr($class, strrpos($class, '\\') + 1);
$class = preg_replace('/([A-Z])', ' $1', $class);
return trim($class);
```

The above makes it clearer what the input is for each function call, which will make understanding the code easier for maintainers.