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

categorize todos

This commit is contained in:
Samuel Štancl 2024-03-12 17:29:00 +01:00
parent a85708429e
commit a0da54cfdc
14 changed files with 18 additions and 19 deletions

View file

@ -11,7 +11,7 @@ use Stancl\Tenancy\Contracts\TenancyBootstrapper;
use Stancl\Tenancy\Contracts\Tenant;
/**
* todo name.
* todo@name rename?
*
* Separate tenant cache using tagging.
* This is the legacy approach. Some things, like dependency injection, won't work properly with this bootstrapper.

View file

@ -13,7 +13,7 @@ use Stancl\Tenancy\Database\Exceptions\NoConnectionSetException;
interface StatefulTenantDatabaseManager extends TenantDatabaseManager
{
/** Get the DB connection used by the tenant database manager. */
public function database(): Connection; // todo rename to connection()
public function database(): Connection; // todo@name rename to connection()
/**
* Set the DB connection that should be used by the tenant database manager.

View file

@ -214,7 +214,7 @@ class DatabaseConfig
}
/**
* todo come up with a better name
* todo@name come up with a better name
* Get database manager class from the given connection config's driver.
*
* @throws DatabaseManagerNotRegisteredException

View file

@ -62,7 +62,7 @@ class UserImpersonation implements Feature
/**
* Logout from the current domain and forget impersonation session.
*/
public static function leave(): void // todo possibly rename
public static function leave(): void // todo@name possibly rename
{
auth()->logout();

View file

@ -8,11 +8,10 @@ use Closure;
use Illuminate\Http\Request;
use Illuminate\Routing\Route;
use Stancl\Tenancy\Concerns\UsableWithEarlyIdentification;
use Stancl\Tenancy\Enums\Context;
use Stancl\Tenancy\Enums\RouteMode;
/**
* todo come up with a better name.
* todo@name come up with a better name.
*
* Prevents accessing central domains in the tenant context/tenant domains in the central context.
* The access isn't prevented if the request is trying to access a route flagged as 'universal',

View file

@ -6,7 +6,7 @@ namespace Stancl\Tenancy\Overrides;
use Illuminate\Cache\CacheManager as BaseCacheManager;
// todo move to Cache namespace?
// todo@move move to Cache namespace?
class CacheManager extends BaseCacheManager
{

View file

@ -48,7 +48,7 @@ class PathTenantResolver extends Contracts\CachedTenantResolver
public function getCacheKey(mixed ...$args): string
{
// todo@samuel: fix the coupling here. when this is called from the cachedresolver, $args are the tenant key. when it's called from within this class, $args are a Route instance
// todo@samuel fix the coupling here. when this is called from the cachedresolver, $args are the tenant key. when it's called from within this class, $args are a Route instance
// the logic shouldn't have to be coupled to where it's being called from
// todo@samuel also make the tenant column configurable

View file

@ -9,7 +9,7 @@ use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Stancl\Tenancy\Contracts\Tenant;
// todo move all resource syncing-related things to a separate namespace?
// todo@move move all resource syncing-related things to a separate namespace?
/**
* @property-read Tenant[]|Collection $tenants

View file

@ -22,11 +22,11 @@ class Tenancy
*/
public Tenant|null $tenant = null;
// todo docblock
// todo@docblock
public ?Closure $getBootstrappersUsing = null;
/** Is tenancy fully initialized? */
public bool $initialized = false; // todo document the difference between $tenant being set and $initialized being true (e.g. end of initialize() method)
public bool $initialized = false; // todo@docs document the difference between $tenant being set and $initialized being true (e.g. end of initialize() method)
/** Initialize tenancy for the passed tenant. */
public function initialize(Tenant|int|string $tenant): void
@ -92,7 +92,7 @@ class Tenancy
event(new Events\EndingTenancy($this));
// todo find a way to refactor these two methods
// todo@samuel find a way to refactor these two methods
event(new Events\TenancyEnded($this));

View file

@ -8,7 +8,7 @@ use Illuminate\Database\Eloquent\Model;
use Ramsey\Uuid\Uuid;
use Stancl\Tenancy\Contracts\UniqueIdentifierGenerator;
// todo move to separate namespace
// todo@move move to separate namespace
class UUIDGenerator implements UniqueIdentifierGenerator
{

View file

@ -35,7 +35,7 @@ if (! function_exists('tenant')) {
}
if (! function_exists('tenant_asset')) {
// todo docblock
// todo@docblock
function tenant_asset(string|null $asset): string
{
if ($assetUrl = config('app.asset_url')) {