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

Enable single_line_empty_body phpcsfixer rule

This commit is contained in:
Samuel Štancl 2024-04-02 04:31:03 +02:00
parent a41ad69023
commit 1d80604cff
77 changed files with 77 additions and 198 deletions

View file

@ -4,6 +4,7 @@ use PhpCsFixer\Config;
use PhpCsFixer\Finder; use PhpCsFixer\Finder;
$rules = [ $rules = [
'single_line_empty_body' => true,
'array_syntax' => ['syntax' => 'short'], 'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [ 'binary_operator_spaces' => [
'default' => 'single_space', 'default' => 'single_space',

View file

@ -44,8 +44,7 @@ class CloneRoutesAsTenant
public function __construct( public function __construct(
protected Router $router, protected Router $router,
) { ) {}
}
public function handle(): void public function handle(): void
{ {

View file

@ -37,8 +37,7 @@ class BroadcastChannelPrefixBootstrapper implements TenancyBootstrapper
public function __construct( public function __construct(
protected Application $app, protected Application $app,
protected BroadcastManager $broadcastManager, protected BroadcastManager $broadcastManager,
) { ) {}
}
public function bootstrap(Tenant $tenant): void public function bootstrap(Tenant $tenant): void
{ {

View file

@ -23,8 +23,7 @@ class CacheTagsBootstrapper implements TenancyBootstrapper
public function __construct( public function __construct(
protected Application $app protected Application $app
) { ) {}
}
public function bootstrap(Tenant $tenant): void public function bootstrap(Tenant $tenant): void
{ {

View file

@ -24,8 +24,7 @@ class CacheTenancyBootstrapper implements TenancyBootstrapper
public function __construct( public function __construct(
protected ConfigRepository $config, protected ConfigRepository $config,
protected CacheManager $cacheManager, protected CacheManager $cacheManager,
) { ) {}
}
public function bootstrap(Tenant $tenant): void public function bootstrap(Tenant $tenant): void
{ {

View file

@ -23,8 +23,7 @@ class DatabaseSessionBootstrapper implements TenancyBootstrapper
protected Repository $config, protected Repository $config,
protected Container $container, protected Container $container,
protected SessionManager $session, protected SessionManager $session,
) { ) {}
}
public function bootstrap(Tenant $tenant): void public function bootstrap(Tenant $tenant): void
{ {

View file

@ -60,8 +60,7 @@ class FortifyRouteBootstrapper implements TenancyBootstrapper
public function __construct( public function __construct(
protected Repository $config, protected Repository $config,
) { ) {}
}
public function bootstrap(Tenant $tenant): void public function bootstrap(Tenant $tenant): void
{ {

View file

@ -14,8 +14,7 @@ class ScoutPrefixBootstrapper implements TenancyBootstrapper
public function __construct( public function __construct(
protected Repository $config, protected Repository $config,
) { ) {}
}
public function bootstrap(Tenant $tenant): void public function bootstrap(Tenant $tenant): void
{ {

View file

@ -23,8 +23,7 @@ class JobBatchBootstrapper implements TenancyBootstrapper
public function __construct( public function __construct(
protected DatabaseBatchRepository $batchRepository, protected DatabaseBatchRepository $batchRepository,
protected DatabaseManager $databaseManager protected DatabaseManager $databaseManager
) { ) {}
}
public function bootstrap(Tenant $tenant): void public function bootstrap(Tenant $tenant): void
{ {

View file

@ -18,8 +18,7 @@ class RootUrlBootstrapper implements TenancyBootstrapper
public function __construct( public function __construct(
protected UrlGenerator $urlGenerator, protected UrlGenerator $urlGenerator,
protected Repository $config, protected Repository $config,
) { ) {}
}
public function bootstrap(Tenant $tenant): void public function bootstrap(Tenant $tenant): void
{ {

View file

@ -26,8 +26,7 @@ class UrlGeneratorBootstrapper implements TenancyBootstrapper
public function __construct( public function __construct(
protected Application $app, protected Application $app,
protected UrlGenerator $originalUrlGenerator, protected UrlGenerator $originalUrlGenerator,
) { ) {}
}
public function bootstrap(Tenant $tenant): void public function bootstrap(Tenant $tenant): void
{ {

View file

@ -7,6 +7,4 @@ namespace Stancl\Tenancy\Contracts;
/** /**
* @property string|null $domain * @property string|null $domain
*/ */
interface SingleDomainTenant extends Tenant interface SingleDomainTenant extends Tenant {}
{
}

View file

@ -19,8 +19,7 @@ class DatabaseManager
protected Application $app, protected Application $app,
protected BaseDatabaseManager $database, protected BaseDatabaseManager $database,
protected Repository $config, protected Repository $config,
) { ) {}
}
/** Connect to a tenant's database. */ /** Connect to a tenant's database. */
public function connectToTenant(TenantWithDatabase $tenant): void public function connectToTenant(TenantWithDatabase $tenant): void

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class BootstrappingTenancy extends Contracts\TenancyEvent class BootstrappingTenancy extends Contracts\TenancyEvent {}
{
}

View file

@ -10,6 +10,5 @@ abstract class TenancyEvent
{ {
public function __construct( public function __construct(
public Tenancy $tenancy, public Tenancy $tenancy,
) { ) {}
}
} }

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class CreatingDatabase extends Contracts\TenantEvent class CreatingDatabase extends Contracts\TenantEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class CreatingDomain extends Contracts\DomainEvent class CreatingDomain extends Contracts\DomainEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class CreatingPendingTenant extends Contracts\TenantEvent class CreatingPendingTenant extends Contracts\TenantEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class CreatingStorageSymlink extends Contracts\TenantEvent class CreatingStorageSymlink extends Contracts\TenantEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class CreatingTenant extends Contracts\TenantEvent class CreatingTenant extends Contracts\TenantEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class DatabaseCreated extends Contracts\TenantEvent class DatabaseCreated extends Contracts\TenantEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class DatabaseDeleted extends Contracts\TenantEvent class DatabaseDeleted extends Contracts\TenantEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class DatabaseMigrated extends Contracts\TenantEvent class DatabaseMigrated extends Contracts\TenantEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class DatabaseRolledBack extends Contracts\TenantEvent class DatabaseRolledBack extends Contracts\TenantEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class DatabaseSeeded extends Contracts\TenantEvent class DatabaseSeeded extends Contracts\TenantEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class DeletingDatabase extends Contracts\TenantEvent class DeletingDatabase extends Contracts\TenantEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class DeletingDomain extends Contracts\DomainEvent class DeletingDomain extends Contracts\DomainEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class DeletingTenant extends Contracts\TenantEvent class DeletingTenant extends Contracts\TenantEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class DomainCreated extends Contracts\DomainEvent class DomainCreated extends Contracts\DomainEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class DomainDeleted extends Contracts\DomainEvent class DomainDeleted extends Contracts\DomainEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class DomainSaved extends Contracts\DomainEvent class DomainSaved extends Contracts\DomainEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class DomainUpdated extends Contracts\DomainEvent class DomainUpdated extends Contracts\DomainEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class EndingTenancy extends Contracts\TenancyEvent class EndingTenancy extends Contracts\TenancyEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class InitializingTenancy extends Contracts\TenancyEvent class InitializingTenancy extends Contracts\TenancyEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class MigratingDatabase extends Contracts\TenantEvent class MigratingDatabase extends Contracts\TenantEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class PendingTenantCreated extends Contracts\TenantEvent class PendingTenantCreated extends Contracts\TenantEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class PendingTenantPulled extends Contracts\TenantEvent class PendingTenantPulled extends Contracts\TenantEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class PullingPendingTenant extends Contracts\TenantEvent class PullingPendingTenant extends Contracts\TenantEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class RemovingStorageSymlink extends Contracts\TenantEvent class RemovingStorageSymlink extends Contracts\TenantEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class RevertedToCentralContext extends Contracts\TenancyEvent class RevertedToCentralContext extends Contracts\TenancyEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class RevertingToCentralContext extends Contracts\TenancyEvent class RevertingToCentralContext extends Contracts\TenancyEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class RollingBackDatabase extends Contracts\TenantEvent class RollingBackDatabase extends Contracts\TenantEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class SavedDomain extends Contracts\DomainEvent class SavedDomain extends Contracts\DomainEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class SavedTenant extends Contracts\TenantEvent class SavedTenant extends Contracts\TenantEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class SavingDomain extends Contracts\DomainEvent class SavingDomain extends Contracts\DomainEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class SavingTenant extends Contracts\TenantEvent class SavingTenant extends Contracts\TenantEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class SeedingDatabase extends Contracts\TenantEvent class SeedingDatabase extends Contracts\TenantEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class StorageSymlinkCreated extends Contracts\TenantEvent class StorageSymlinkCreated extends Contracts\TenantEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class StorageSymlinkRemoved extends Contracts\TenantEvent class StorageSymlinkRemoved extends Contracts\TenantEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class TenancyBootstrapped extends Contracts\TenancyEvent class TenancyBootstrapped extends Contracts\TenancyEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class TenancyEnded extends Contracts\TenancyEvent class TenancyEnded extends Contracts\TenancyEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class TenancyInitialized extends Contracts\TenancyEvent class TenancyInitialized extends Contracts\TenancyEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class TenantCreated extends Contracts\TenantEvent class TenantCreated extends Contracts\TenantEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class TenantDeleted extends Contracts\TenantEvent class TenantDeleted extends Contracts\TenantEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class TenantSaved extends Contracts\TenantEvent class TenantSaved extends Contracts\TenantEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class TenantUpdated extends Contracts\TenantEvent class TenantUpdated extends Contracts\TenantEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class UpdatingDomain extends Contracts\DomainEvent class UpdatingDomain extends Contracts\DomainEvent {}
{
}

View file

@ -4,6 +4,4 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Events; namespace Stancl\Tenancy\Events;
class UpdatingTenant extends Contracts\TenantEvent class UpdatingTenant extends Contracts\TenantEvent {}
{
}

View file

@ -25,8 +25,7 @@ class TenantConfig implements Feature
public function __construct( public function __construct(
protected Repository $config, protected Repository $config,
) { ) {}
}
public function bootstrap(Tenancy $tenancy): void public function bootstrap(Tenancy $tenancy): void
{ {

View file

@ -25,8 +25,7 @@ class CreateDatabase implements ShouldQueue
public function __construct( public function __construct(
protected TenantWithDatabase&Model $tenant, protected TenantWithDatabase&Model $tenant,
) { ) {}
}
public function handle(DatabaseManager $databaseManager): bool public function handle(DatabaseManager $databaseManager): bool
{ {

View file

@ -18,8 +18,7 @@ class CreateStorageSymlinks implements ShouldQueue
public function __construct( public function __construct(
public Tenant $tenant, public Tenant $tenant,
) { ) {}
}
public function handle(): void public function handle(): void
{ {

View file

@ -20,8 +20,7 @@ class DeleteDatabase implements ShouldQueue
public function __construct( public function __construct(
protected TenantWithDatabase&Model $tenant, protected TenantWithDatabase&Model $tenant,
) { ) {}
}
public function handle(): void public function handle(): void
{ {

View file

@ -19,8 +19,7 @@ class MigrateDatabase implements ShouldQueue
public function __construct( public function __construct(
protected TenantWithDatabase&Model $tenant, protected TenantWithDatabase&Model $tenant,
) { ) {}
}
public function handle(): void public function handle(): void
{ {

View file

@ -19,8 +19,7 @@ class SeedDatabase implements ShouldQueue
public function __construct( public function __construct(
protected TenantWithDatabase&Model $tenant, protected TenantWithDatabase&Model $tenant,
) { ) {}
}
public function handle(): void public function handle(): void
{ {

View file

@ -12,8 +12,7 @@ class CreateTenantConnection
{ {
public function __construct( public function __construct(
protected DatabaseManager $database, protected DatabaseManager $database,
) { ) {}
}
public function handle(TenancyEvent $event): void public function handle(TenancyEvent $event): void
{ {

View file

@ -11,8 +11,7 @@ class UseCentralConnection
{ {
public function __construct( public function __construct(
protected DatabaseManager $database, protected DatabaseManager $database,
) { ) {}
}
public function handle(TenancyEvent $event): void public function handle(TenancyEvent $event): void
{ {

View file

@ -11,8 +11,7 @@ class UseTenantConnection
{ {
public function __construct( public function __construct(
protected DatabaseManager $database, protected DatabaseManager $database,
) { ) {}
}
public function handle(TenancyEvent $event): void public function handle(TenancyEvent $event): void
{ {

View file

@ -20,8 +20,7 @@ class InitializeTenancyByDomain extends IdentificationMiddleware implements Usab
public function __construct( public function __construct(
protected Tenancy $tenancy, protected Tenancy $tenancy,
protected DomainTenantResolver $resolver, protected DomainTenantResolver $resolver,
) { ) {}
}
/** @return \Illuminate\Http\Response|mixed */ /** @return \Illuminate\Http\Response|mixed */
public function handle(Request $request, Closure $next): mixed public function handle(Request $request, Closure $next): mixed

View file

@ -25,8 +25,7 @@ class InitializeTenancyByPath extends IdentificationMiddleware implements Usable
public function __construct( public function __construct(
protected Tenancy $tenancy, protected Tenancy $tenancy,
protected PathTenantResolver $resolver, protected PathTenantResolver $resolver,
) { ) {}
}
/** @return \Illuminate\Http\Response|mixed */ /** @return \Illuminate\Http\Response|mixed */
public function handle(Request $request, Closure $next): mixed public function handle(Request $request, Closure $next): mixed

View file

@ -25,8 +25,7 @@ class InitializeTenancyByRequestData extends IdentificationMiddleware implements
public function __construct( public function __construct(
protected Tenancy $tenancy, protected Tenancy $tenancy,
protected RequestDataTenantResolver $resolver, protected RequestDataTenantResolver $resolver,
) { ) {}
}
/** @return \Illuminate\Http\Response|mixed */ /** @return \Illuminate\Http\Response|mixed */
public function handle(Request $request, Closure $next): mixed public function handle(Request $request, Closure $next): mixed

View file

@ -81,9 +81,7 @@ abstract class CachedTenantResolver implements TenantResolver
* *
* Used for side effects like removing the tenant parameter from the request route. * Used for side effects like removing the tenant parameter from the request route.
*/ */
public function resolved(Tenant $tenant, mixed ...$args): void public function resolved(Tenant $tenant, mixed ...$args): void {}
{
}
abstract public function getPossibleCacheKeys(Tenant&Model $tenant): array; abstract public function getPossibleCacheKeys(Tenant&Model $tenant): array;

View file

@ -13,6 +13,5 @@ class CentralResourceAttachedToTenant
public function __construct( public function __construct(
public SyncMaster&Model $centralResource, public SyncMaster&Model $centralResource,
public TenantWithDatabase $tenant, public TenantWithDatabase $tenant,
) { ) {}
}
} }

View file

@ -13,6 +13,5 @@ class CentralResourceDetachedFromTenant
public function __construct( public function __construct(
public SyncMaster&Model $centralResource, public SyncMaster&Model $centralResource,
public TenantWithDatabase $tenant, public TenantWithDatabase $tenant,
) { ) {}
}
} }

View file

@ -12,6 +12,5 @@ class SyncMasterDeleted
public function __construct( public function __construct(
public SyncMaster&Model $centralResource, public SyncMaster&Model $centralResource,
public bool $forceDelete = false, public bool $forceDelete = false,
) { ) {}
}
} }

View file

@ -11,6 +11,5 @@ class SyncMasterRestored
{ {
public function __construct( public function __construct(
public SyncMaster&Model $centralResource public SyncMaster&Model $centralResource
) { ) {}
}
} }

View file

@ -13,6 +13,5 @@ class SyncedResourceSaved
public function __construct( public function __construct(
public Syncable&Model $model, public Syncable&Model $model,
public TenantWithDatabase|null $tenant, public TenantWithDatabase|null $tenant,
) { ) {}
}
} }

View file

@ -14,6 +14,5 @@ class SyncedResourceSavedInForeignDatabase
public function __construct( public function __construct(
public Syncable&Model $model, public Syncable&Model $model,
public TenantWithDatabase|null $tenant public TenantWithDatabase|null $tenant
) { ) {}
}
} }