1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 15:34:03 +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

@ -200,7 +200,7 @@ return [
// 'pgsql' => Stancl\Tenancy\Database\TenantDatabaseManagers\PostgreSQLSchemaManager::class, // Separate by schema instead of database // 'pgsql' => Stancl\Tenancy\Database\TenantDatabaseManagers\PostgreSQLSchemaManager::class, // Separate by schema instead of database
], ],
// todo docblock // todo@docblock
'drop_tenant_databases_on_migrate_fresh' => false, 'drop_tenant_databases_on_migrate_fresh' => false,
], ],

View file

@ -11,7 +11,7 @@ use Stancl\Tenancy\Contracts\TenancyBootstrapper;
use Stancl\Tenancy\Contracts\Tenant; use Stancl\Tenancy\Contracts\Tenant;
/** /**
* todo name. * todo@name rename?
* *
* Separate tenant cache using tagging. * Separate tenant cache using tagging.
* This is the legacy approach. Some things, like dependency injection, won't work properly with this bootstrapper. * 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 interface StatefulTenantDatabaseManager extends TenantDatabaseManager
{ {
/** Get the DB connection used by the tenant database manager. */ /** 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. * 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. * Get database manager class from the given connection config's driver.
* *
* @throws DatabaseManagerNotRegisteredException * @throws DatabaseManagerNotRegisteredException

View file

@ -62,7 +62,7 @@ class UserImpersonation implements Feature
/** /**
* Logout from the current domain and forget impersonation session. * 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(); auth()->logout();

View file

@ -8,11 +8,10 @@ use Closure;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Routing\Route; use Illuminate\Routing\Route;
use Stancl\Tenancy\Concerns\UsableWithEarlyIdentification; use Stancl\Tenancy\Concerns\UsableWithEarlyIdentification;
use Stancl\Tenancy\Enums\Context;
use Stancl\Tenancy\Enums\RouteMode; 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. * 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', * 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; use Illuminate\Cache\CacheManager as BaseCacheManager;
// todo move to Cache namespace? // todo@move move to Cache namespace?
class CacheManager extends BaseCacheManager class CacheManager extends BaseCacheManager
{ {

View file

@ -48,7 +48,7 @@ class PathTenantResolver extends Contracts\CachedTenantResolver
public function getCacheKey(mixed ...$args): string 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 // the logic shouldn't have to be coupled to where it's being called from
// todo@samuel also make the tenant column configurable // 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 Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Stancl\Tenancy\Contracts\Tenant; 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 * @property-read Tenant[]|Collection $tenants

View file

@ -22,11 +22,11 @@ class Tenancy
*/ */
public Tenant|null $tenant = null; public Tenant|null $tenant = null;
// todo docblock // todo@docblock
public ?Closure $getBootstrappersUsing = null; public ?Closure $getBootstrappersUsing = null;
/** Is tenancy fully initialized? */ /** 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. */ /** Initialize tenancy for the passed tenant. */
public function initialize(Tenant|int|string $tenant): void public function initialize(Tenant|int|string $tenant): void
@ -92,7 +92,7 @@ class Tenancy
event(new Events\EndingTenancy($this)); 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)); event(new Events\TenancyEnded($this));

View file

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

View file

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

View file

@ -17,7 +17,7 @@ beforeEach(function () {
Event::listen(TenancyEnded::class, RevertToCentralContext::class); Event::listen(TenancyEnded::class, RevertToCentralContext::class);
}); });
// todo move these to be in the same file as the other tests from this PR (#909) rather than generic "action tests" // todo@move move these to be in the same file as the other tests from this PR (#909) rather than generic "action tests"
test('create storage symlinks action works', function() { test('create storage symlinks action works', function() {
config([ config([

View file

@ -44,7 +44,7 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase
'--realpath' => true, '--realpath' => true,
]); ]);
// Laravel 6.x support todo clean up // Laravel 6.x support todo@refactor clean up
$testResponse = class_exists('Illuminate\Testing\TestResponse') ? 'Illuminate\Testing\TestResponse' : 'Illuminate\Foundation\Testing\TestResponse'; $testResponse = class_exists('Illuminate\Testing\TestResponse') ? 'Illuminate\Testing\TestResponse' : 'Illuminate\Foundation\Testing\TestResponse';
$testResponse::macro('assertContent', function ($content) { $testResponse::macro('assertContent', function ($content) {
$assertClass = class_exists('Illuminate\Testing\Assert') ? 'Illuminate\Testing\Assert' : 'Illuminate\Foundation\Testing\Assert'; $assertClass = class_exists('Illuminate\Testing\Assert') ? 'Illuminate\Testing\Assert' : 'Illuminate\Foundation\Testing\Assert';
@ -129,8 +129,8 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase
'tenancy.models.tenant' => Tenant::class, // Use test tenant w/ DBs & domains 'tenancy.models.tenant' => Tenant::class, // Use test tenant w/ DBs & domains
]); ]);
$app->singleton(RedisTenancyBootstrapper::class); // todo (Samuel) use proper approach eg config for singleton registration $app->singleton(RedisTenancyBootstrapper::class); // todo@samuel use proper approach eg config for singleton registration
$app->singleton(PrefixCacheTenancyBootstrapper::class); // todo (Samuel) use proper approach eg config for singleton registration $app->singleton(PrefixCacheTenancyBootstrapper::class); // todo@samuel use proper approach eg config for singleton registration
$app->singleton(BroadcastingConfigBootstrapper::class); $app->singleton(BroadcastingConfigBootstrapper::class);
$app->singleton(BroadcastChannelPrefixBootstrapper::class); $app->singleton(BroadcastChannelPrefixBootstrapper::class);
$app->singleton(MailTenancyBootstrapper::class); $app->singleton(MailTenancyBootstrapper::class);