From a0da54cfdc089cf4c1707018ee10c2e699d22b16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Tue, 12 Mar 2024 17:29:00 +0100 Subject: [PATCH] categorize todos --- assets/config.php | 2 +- src/Bootstrappers/CacheTagsBootstrapper.php | 2 +- src/Database/Contracts/StatefulTenantDatabaseManager.php | 2 +- src/Database/DatabaseConfig.php | 2 +- src/Features/UserImpersonation.php | 2 +- src/Middleware/PreventAccessFromUnwantedDomains.php | 3 +-- src/Overrides/CacheManager.php | 2 +- src/Resolvers/PathTenantResolver.php | 2 +- src/ResourceSyncing/SyncMaster.php | 2 +- src/Tenancy.php | 6 +++--- src/UUIDGenerator.php | 2 +- src/helpers.php | 2 +- tests/ActionTest.php | 2 +- tests/TestCase.php | 6 +++--- 14 files changed, 18 insertions(+), 19 deletions(-) diff --git a/assets/config.php b/assets/config.php index 2c745c64..5b55fa66 100644 --- a/assets/config.php +++ b/assets/config.php @@ -200,7 +200,7 @@ return [ // 'pgsql' => Stancl\Tenancy\Database\TenantDatabaseManagers\PostgreSQLSchemaManager::class, // Separate by schema instead of database ], - // todo docblock + // todo@docblock 'drop_tenant_databases_on_migrate_fresh' => false, ], diff --git a/src/Bootstrappers/CacheTagsBootstrapper.php b/src/Bootstrappers/CacheTagsBootstrapper.php index eeca1a79..b9fdb0c3 100644 --- a/src/Bootstrappers/CacheTagsBootstrapper.php +++ b/src/Bootstrappers/CacheTagsBootstrapper.php @@ -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. diff --git a/src/Database/Contracts/StatefulTenantDatabaseManager.php b/src/Database/Contracts/StatefulTenantDatabaseManager.php index 1a2e928d..1b6c8490 100644 --- a/src/Database/Contracts/StatefulTenantDatabaseManager.php +++ b/src/Database/Contracts/StatefulTenantDatabaseManager.php @@ -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. diff --git a/src/Database/DatabaseConfig.php b/src/Database/DatabaseConfig.php index 52303606..ee13f00c 100644 --- a/src/Database/DatabaseConfig.php +++ b/src/Database/DatabaseConfig.php @@ -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 diff --git a/src/Features/UserImpersonation.php b/src/Features/UserImpersonation.php index 5921e656..ce6687b0 100644 --- a/src/Features/UserImpersonation.php +++ b/src/Features/UserImpersonation.php @@ -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(); diff --git a/src/Middleware/PreventAccessFromUnwantedDomains.php b/src/Middleware/PreventAccessFromUnwantedDomains.php index be505e06..06dd89fb 100644 --- a/src/Middleware/PreventAccessFromUnwantedDomains.php +++ b/src/Middleware/PreventAccessFromUnwantedDomains.php @@ -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', diff --git a/src/Overrides/CacheManager.php b/src/Overrides/CacheManager.php index 0495c951..f712025b 100644 --- a/src/Overrides/CacheManager.php +++ b/src/Overrides/CacheManager.php @@ -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 { diff --git a/src/Resolvers/PathTenantResolver.php b/src/Resolvers/PathTenantResolver.php index ced358ac..3abd8abf 100644 --- a/src/Resolvers/PathTenantResolver.php +++ b/src/Resolvers/PathTenantResolver.php @@ -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 diff --git a/src/ResourceSyncing/SyncMaster.php b/src/ResourceSyncing/SyncMaster.php index 75723af4..f4f6f07a 100644 --- a/src/ResourceSyncing/SyncMaster.php +++ b/src/ResourceSyncing/SyncMaster.php @@ -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 diff --git a/src/Tenancy.php b/src/Tenancy.php index 2786f5e3..e9eae418 100644 --- a/src/Tenancy.php +++ b/src/Tenancy.php @@ -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)); diff --git a/src/UUIDGenerator.php b/src/UUIDGenerator.php index a0974862..6ac59519 100644 --- a/src/UUIDGenerator.php +++ b/src/UUIDGenerator.php @@ -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 { diff --git a/src/helpers.php b/src/helpers.php index 754868bc..333c2829 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -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')) { diff --git a/tests/ActionTest.php b/tests/ActionTest.php index e1727c94..1adcb32d 100644 --- a/tests/ActionTest.php +++ b/tests/ActionTest.php @@ -17,7 +17,7 @@ beforeEach(function () { 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() { config([ diff --git a/tests/TestCase.php b/tests/TestCase.php index 05fc1f3f..1d7cc043 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -44,7 +44,7 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase '--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::macro('assertContent', function ($content) { $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 ]); - $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(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(BroadcastingConfigBootstrapper::class); $app->singleton(BroadcastChannelPrefixBootstrapper::class); $app->singleton(MailTenancyBootstrapper::class);