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

Remove support for onFail without arguments to improve performance

This commit is contained in:
Samuel Štancl 2019-03-04 22:19:38 +01:00 committed by GitHub
parent 4c7e6c0e06
commit ddc0e6fb1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,13 +25,7 @@ class InitializeTenancy
try {
tenancy()->init();
} catch (\Exception $e) {
// Pass the exception to the onFail function if it takes any parameters.
$callback = $this->onFail;
if ((new \ReflectionFunction($callback))->getNumberOfParameters() > 0) {
$callback($e);
} else {
$callback();
}
($this->onFail)($e);
}
return $next($request);