mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 05:14:05 +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 Stancl\Tenancy\Enums\RouteMode;
|
||||
|
||||
// todo@refactor move this logic to some dedicated static class?
|
||||
|
||||
/**
|
||||
* @mixin \Stancl\Tenancy\Tenancy
|
||||
* @internal The public methods in this trait should not be understood to be a public stable API.
|
||||
*/
|
||||
trait DealsWithRouteContexts
|
||||
{
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ class DisallowSqliteAttach implements Feature
|
|||
|
||||
protected function setNativeAuthorizer(PDO $pdo): void
|
||||
{
|
||||
// @phpstan-ignore method.notFound
|
||||
$pdo->setAuthorizer(static function (int $action): int {
|
||||
return $action === 24 // SQLITE_ATTACH
|
||||
? PDO\Sqlite::DENY
|
||||
|
|
|
|||
|
|
@ -8,8 +8,6 @@ use Illuminate\Routing\Events\RouteMatched;
|
|||
use Stancl\Tenancy\Enums\RouteMode;
|
||||
use Stancl\Tenancy\Resolvers\PathTenantResolver;
|
||||
|
||||
// todo@earlyIdReview
|
||||
|
||||
/**
|
||||
* Conditionally removes the tenant parameter from matched routes when using kernel path identification.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class Tenancy
|
|||
public ?Closure $getBootstrappersUsing = null;
|
||||
|
||||
/** 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().
|
||||
|
|
@ -139,10 +139,12 @@ class Tenancy
|
|||
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));
|
||||
|
||||
// todo@samuel find a way to refactor these two methods
|
||||
|
||||
event(new Events\TenancyEnded($this));
|
||||
|
||||
$this->tenant = null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue