mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 02:14:03 +00:00
Merge branch 'telescope-tags' of github.com:stancl/tenancy into telescope-tags
This commit is contained in:
commit
886123ce62
1 changed files with 4 additions and 4 deletions
|
|
@ -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];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue