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

Refactor more old code and get tests to pass

This commit is contained in:
Samuel Štancl 2020-05-13 04:51:37 +02:00
parent c5377a16f7
commit c32f229dd5
72 changed files with 425 additions and 531 deletions

View file

@ -4,7 +4,7 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Contracts;
use Stancl\Tenancy\Facades\Tenancy;
use Stancl\Tenancy\Tenancy;
/** Additional features, like Telescope tags and tenant redirects. */
interface Feature

View file

@ -1,21 +0,0 @@
<?php
declare(strict_types=1);
namespace Stancl\Tenancy\Contracts\Future;
use Stancl\Tenancy\Tenant;
/**
* This interface will be part of the StorageDriver interface in 3.x.
*/
interface CanDeleteKeys
{
/**
* Delete keys from the storage.
*
* @param string[] $keys
* @return void
*/
public function deleteMany(array $keys, Tenant $tenant = null): void;
}

View file

@ -1,24 +0,0 @@
<?php
declare(strict_types=1);
namespace Stancl\Tenancy\Contracts\Future;
use Stancl\Tenancy\Exceptions\TenantDoesNotExistException;
use Stancl\Tenancy\Tenant;
/**
* This interface *might* be part of the StorageDriver interface in 3.x.
*/
interface CanFindByAnyKey
{
/**
* Find a tenant using an arbitrary key.
*
* @param string $key
* @param mixed $value
* @return Tenant
* @throws TenantDoesNotExistException
*/
public function findBy(string $key, $value): Tenant;
}

View file

@ -1,13 +0,0 @@
<?php
declare(strict_types=1);
namespace Stancl\Tenancy\Contracts\Future;
/**
* This interface *might* be part of the TenantDatabaseManager interface in 3.x.
*/
interface CanSetConnection
{
public function setConnection(string $connection): void;
}

View file

@ -9,8 +9,7 @@ namespace Stancl\Tenancy\Contracts;
*/
interface TenancyBootstrapper
{
// todo rename methods
public function start(Tenant $tenant);
public function bootstrap(Tenant $tenant);
public function end();
public function revert();
}

View file

@ -32,4 +32,12 @@ interface TenantDatabaseManager
* @return array
*/
public function makeConnectionConfig(array $baseConfig, string $databaseName): array;
/**
* Set the DB connection that should be used by the tenant database manager.
*
* @param string $connection
* @return void
*/
public function setConnection(string $connection): void;
}