mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 18:44:03 +00:00
Pass arguments to events by reference
This commit is contained in:
parent
3ec4314e91
commit
464832be29
1 changed files with 1 additions and 1 deletions
|
|
@ -432,7 +432,7 @@ class TenantManager
|
||||||
* @param mixed ...$args
|
* @param mixed ...$args
|
||||||
* @return string[]
|
* @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) {
|
return array_reduce($this->eventListeners[$name] ?? [], function ($results, $listener) use ($args) {
|
||||||
$results = array_merge($results, $listener($this, ...$args) ?? []);
|
$results = array_merge($results, $listener($this, ...$args) ?? []);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue