Note: This is uncommon and discouraged for new hooks, but some hooks require returning values, e.g
```php
function hook_foo() {
return ['my-data'];
}
```
This should fix compatibility with those.
}
public function __invoke(GenericHookEvent $e) {
- return call_user_func_array($this->callback, $e->getHookValues());
+ $result = call_user_func_array($this->callback, $e->getHookValues());
+ $e->addReturnValues($result);
}
- public function __toString() {
+ public function __toString(): string {
$name = EventPrinter::formatName($this->callback);
return preg_replace('/\(\$?e?\)$/', '(&...)', $name);
}