mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 21:54:03 +00:00
misc improvements - stronger types, exception refactor
This commit is contained in:
parent
ddc7cf49c3
commit
55d0a9ab87
34 changed files with 179 additions and 209 deletions
|
|
@ -11,14 +11,11 @@ use Stancl\Tenancy\Contracts\TenantResolver;
|
|||
|
||||
abstract class CachedTenantResolver implements TenantResolver
|
||||
{
|
||||
/** @var bool */
|
||||
public static $shouldCache = false;
|
||||
public static bool $shouldCache = false; // todo docblocks for these
|
||||
|
||||
/** @var int */
|
||||
public static $cacheTTL = 3600; // seconds
|
||||
public static int $cacheTTL = 3600; // seconds
|
||||
|
||||
/** @var string|null */
|
||||
public static $cacheStore = null; // default
|
||||
public static string|null $cacheStore = null; // default
|
||||
|
||||
/** @var Repository */
|
||||
protected $cache;
|
||||
|
|
|
|||
|
|
@ -11,21 +11,14 @@ use Stancl\Tenancy\Exceptions\TenantCouldNotBeIdentifiedOnDomainException;
|
|||
|
||||
class DomainTenantResolver extends Contracts\CachedTenantResolver
|
||||
{
|
||||
/**
|
||||
* The model representing the domain that the tenant was identified on.
|
||||
*
|
||||
* @var Domain
|
||||
*/
|
||||
public static $currentDomain;
|
||||
/** The model representing the domain that the tenant was identified on. */
|
||||
public static Domain $currentDomain; // todo |null?
|
||||
|
||||
/** @var bool */
|
||||
public static $shouldCache = false;
|
||||
public static bool $shouldCache = false;
|
||||
|
||||
/** @var int */
|
||||
public static $cacheTTL = 3600; // seconds
|
||||
public static int $cacheTTL = 3600; // seconds
|
||||
|
||||
/** @var string|null */
|
||||
public static $cacheStore = null; // default
|
||||
public static string|null $cacheStore = null; // default
|
||||
|
||||
public function resolveWithoutCache(...$args): Tenant
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,16 +10,13 @@ use Stancl\Tenancy\Exceptions\TenantCouldNotBeIdentifiedByPathException;
|
|||
|
||||
class PathTenantResolver extends Contracts\CachedTenantResolver
|
||||
{
|
||||
public static $tenantParameterName = 'tenant';
|
||||
public static string $tenantParameterName = 'tenant';
|
||||
|
||||
/** @var bool */
|
||||
public static $shouldCache = false;
|
||||
public static bool $shouldCache = false;
|
||||
|
||||
/** @var int */
|
||||
public static $cacheTTL = 3600; // seconds
|
||||
public static int $cacheTTL = 3600; // seconds
|
||||
|
||||
/** @var string|null */
|
||||
public static $cacheStore = null; // default
|
||||
public static string|null $cacheStore = null; // default
|
||||
|
||||
public function resolveWithoutCache(...$args): Tenant
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,14 +9,11 @@ use Stancl\Tenancy\Exceptions\TenantCouldNotBeIdentifiedByRequestDataException;
|
|||
|
||||
class RequestDataTenantResolver extends Contracts\CachedTenantResolver
|
||||
{
|
||||
/** @var bool */
|
||||
public static $shouldCache = false;
|
||||
public static bool $shouldCache = false;
|
||||
|
||||
/** @var int */
|
||||
public static $cacheTTL = 3600; // seconds
|
||||
public static int $cacheTTL = 3600; // seconds
|
||||
|
||||
/** @var string|null */
|
||||
public static $cacheStore = null; // default
|
||||
public static string|null $cacheStore = null; // default
|
||||
|
||||
public function resolveWithoutCache(...$args): Tenant
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue