1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 07:54:03 +00:00

Apply fixes from StyleCI

This commit is contained in:
stancl 2019-08-19 18:28:29 +00:00 committed by StyleCI Bot
parent 4c80ba78d3
commit 63f455d09c

View file

@ -99,7 +99,7 @@ trait TenantManagerEvents
*/ */
public function integrationEvent(string $name, callable $callback) public function integrationEvent(string $name, callable $callback)
{ {
if (array_key_exists($name, $this->integrationListeners)) { if (\array_key_exists($name, $this->integrationListeners)) {
$this->integrationListeners[$name][] = $callback; $this->integrationListeners[$name][] = $callback;
} else { } else {
$this->integrationListeners[$name] = [$callback]; $this->integrationListeners[$name] = [$callback];
@ -117,10 +117,10 @@ trait TenantManagerEvents
{ {
if ($arguments) { if ($arguments) {
// If $arguments are supplied, execute all listeners with arguments. // If $arguments are supplied, execute all listeners with arguments.
return array_reduce($this->integrationListeners[$name] ?? [], function ($tags, $listener) use ($arguments) { return \array_reduce($this->integrationListeners[$name] ?? [], function ($tags, $listener) use ($arguments) {
return array_merge($tags, $listener(...$arguments)); return \array_merge($tags, $listener(...$arguments));
}, []); }, []);
}; }
return $this->integrationListeners[$name]; return $this->integrationListeners[$name];
} }