1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 16:14:02 +00:00

Pass arguments to events by reference

This commit is contained in:
Samuel Štancl 2019-10-28 14:59:25 +01:00
parent 3ec4314e91
commit 464832be29

View file

@ -432,7 +432,7 @@ class TenantManager
* @param mixed ...$args
* @return string[]
*/
public function event(string $name, ...$args): array
public function event(string $name, &...$args): array
{
return array_reduce($this->eventListeners[$name] ?? [], function ($results, $listener) use ($args) {
$results = array_merge($results, $listener($this, ...$args) ?? []);