mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 12:24:04 +00:00
Resolve misc todos, fix phpstan error
This commit is contained in:
parent
be93d6031c
commit
5dfb4843b9
4 changed files with 8 additions and 8 deletions
|
|
@ -14,10 +14,9 @@ use Illuminate\Support\Arr;
|
||||||
use Illuminate\Support\Facades\Route as RouteFacade;
|
use Illuminate\Support\Facades\Route as RouteFacade;
|
||||||
use Stancl\Tenancy\Enums\RouteMode;
|
use Stancl\Tenancy\Enums\RouteMode;
|
||||||
|
|
||||||
// todo@refactor move this logic to some dedicated static class?
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @mixin \Stancl\Tenancy\Tenancy
|
* @mixin \Stancl\Tenancy\Tenancy
|
||||||
|
* @internal The public methods in this trait should not be understood to be a public stable API.
|
||||||
*/
|
*/
|
||||||
trait DealsWithRouteContexts
|
trait DealsWithRouteContexts
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,7 @@ class DisallowSqliteAttach implements Feature
|
||||||
|
|
||||||
protected function setNativeAuthorizer(PDO $pdo): void
|
protected function setNativeAuthorizer(PDO $pdo): void
|
||||||
{
|
{
|
||||||
|
// @phpstan-ignore method.notFound
|
||||||
$pdo->setAuthorizer(static function (int $action): int {
|
$pdo->setAuthorizer(static function (int $action): int {
|
||||||
return $action === 24 // SQLITE_ATTACH
|
return $action === 24 // SQLITE_ATTACH
|
||||||
? PDO\Sqlite::DENY
|
? PDO\Sqlite::DENY
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,6 @@ use Illuminate\Routing\Events\RouteMatched;
|
||||||
use Stancl\Tenancy\Enums\RouteMode;
|
use Stancl\Tenancy\Enums\RouteMode;
|
||||||
use Stancl\Tenancy\Resolvers\PathTenantResolver;
|
use Stancl\Tenancy\Resolvers\PathTenantResolver;
|
||||||
|
|
||||||
// todo@earlyIdReview
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conditionally removes the tenant parameter from matched routes when using kernel path identification.
|
* Conditionally removes the tenant parameter from matched routes when using kernel path identification.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ class Tenancy
|
||||||
public ?Closure $getBootstrappersUsing = null;
|
public ?Closure $getBootstrappersUsing = null;
|
||||||
|
|
||||||
/** Is tenancy fully initialized? */
|
/** Is tenancy fully initialized? */
|
||||||
public bool $initialized = false; // todo@docs document the difference between $tenant being set and $initialized being true (e.g. end of initialize() method)
|
public bool $initialized = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of relations to eager load when fetching a tenant via tenancy()->find().
|
* List of relations to eager load when fetching a tenant via tenancy()->find().
|
||||||
|
|
@ -139,10 +139,12 @@ class Tenancy
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We fire both of these events before unsetting tenant so that listeners
|
||||||
|
// to both events can access the current tenant. Having separate events
|
||||||
|
// still has value as it's consistent with our other events and provides
|
||||||
|
// more granularity for event listeners, e.g. for ensuring something runs
|
||||||
|
// before standard TenancyEnded listeners such as RevertToCentralContext.
|
||||||
event(new Events\EndingTenancy($this));
|
event(new Events\EndingTenancy($this));
|
||||||
|
|
||||||
// todo@samuel find a way to refactor these two methods
|
|
||||||
|
|
||||||
event(new Events\TenancyEnded($this));
|
event(new Events\TenancyEnded($this));
|
||||||
|
|
||||||
$this->tenant = null;
|
$this->tenant = null;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue