1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 22:14:03 +00:00

phpstan, global_cache, resolver improvements, InitializationHelpers trait

This commit is contained in:
Samuel Štancl 2022-09-29 02:47:13 +02:00
parent fd65cf1754
commit 87212e5390
35 changed files with 170 additions and 231 deletions

View file

@ -16,22 +16,15 @@ use Stancl\Tenancy\Tenancy;
class InitializeTenancyByPath extends IdentificationMiddleware
{
/** @var callable|null */
public static $onFail;
public static ?Closure $onFail = null;
/** @var Tenancy */
protected $tenancy;
public function __construct(
protected Tenancy $tenancy,
protected PathTenantResolver $resolver,
) {}
/** @var PathTenantResolver */
protected $resolver;
public function __construct(Tenancy $tenancy, PathTenantResolver $resolver)
{
$this->tenancy = $tenancy;
$this->resolver = $resolver;
}
public function handle(Request $request, Closure $next)
/** @return \Illuminate\Http\Response|mixed */
public function handle(Request $request, Closure $next): mixed
{
/** @var Route $route */
$route = $request->route();