mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 20:14:03 +00:00
Remove support for onFail without arguments to improve performance
This commit is contained in:
parent
4c7e6c0e06
commit
ddc0e6fb1e
1 changed files with 1 additions and 7 deletions
|
|
@ -25,13 +25,7 @@ class InitializeTenancy
|
||||||
try {
|
try {
|
||||||
tenancy()->init();
|
tenancy()->init();
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
// Pass the exception to the onFail function if it takes any parameters.
|
($this->onFail)($e);
|
||||||
$callback = $this->onFail;
|
|
||||||
if ((new \ReflectionFunction($callback))->getNumberOfParameters() > 0) {
|
|
||||||
$callback($e);
|
|
||||||
} else {
|
|
||||||
$callback();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $next($request);
|
return $next($request);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue