mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 16:54:05 +00:00
Fix styling
This commit is contained in:
parent
68846f34d1
commit
9edf139be0
21 changed files with 9 additions and 53 deletions
|
|
@ -13,7 +13,6 @@ class CacheManager extends BaseCacheManager
|
|||
*
|
||||
* @param string $method
|
||||
* @param array $parameters
|
||||
* @return mixed
|
||||
*/
|
||||
public function __call($method, $parameters)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -24,8 +24,6 @@ class Install extends Command
|
|||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -33,8 +33,6 @@ class Migrate extends MigrateCommand
|
|||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -31,8 +31,6 @@ final class MigrateFresh extends Command
|
|||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -42,8 +42,6 @@ class Rollback extends RollbackCommand
|
|||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -27,8 +27,6 @@ class Run extends Command
|
|||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -35,8 +35,6 @@ class Seed extends SeedCommand
|
|||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -25,8 +25,6 @@ class TenantList extends Command
|
|||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ trait HasATenantsOption
|
|||
protected function getOptions()
|
||||
{
|
||||
return array_merge([
|
||||
['tenants', null, InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL, '', null],
|
||||
['tenants', null, InputOption::VALUE_IS_ARRAY|InputOption::VALUE_OPTIONAL, '', null],
|
||||
], parent::getOptions());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,18 +20,11 @@ interface TenantDatabaseManager
|
|||
|
||||
/**
|
||||
* Does a database exist.
|
||||
*
|
||||
* @param string $name
|
||||
* @return bool
|
||||
*/
|
||||
public function databaseExists(string $name): bool;
|
||||
|
||||
/**
|
||||
* Make a DB connection config array.
|
||||
*
|
||||
* @param array $baseConfig
|
||||
* @param string $databaseName
|
||||
* @return array
|
||||
*/
|
||||
public function makeConnectionConfig(array $baseConfig, string $databaseName): array;
|
||||
|
||||
|
|
@ -39,9 +32,6 @@ interface TenantDatabaseManager
|
|||
* Set the DB connection that should be used by the tenant database manager.
|
||||
*
|
||||
* @throws NoConnectionSetException
|
||||
*
|
||||
* @param string $connection
|
||||
* @return void
|
||||
*/
|
||||
public function setConnection(string $connection): void;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,9 +11,6 @@ trait TenantRun
|
|||
/**
|
||||
* Run a callback in this tenant's context.
|
||||
* Atomic, safely reverts to previous context.
|
||||
*
|
||||
* @param callable $callback
|
||||
* @return mixed
|
||||
*/
|
||||
public function run(callable $callback)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -80,8 +80,6 @@ class DatabaseConfig
|
|||
|
||||
/**
|
||||
* Generate DB name, username & password and write them to the tenant model.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function makeCredentials(): void
|
||||
{
|
||||
|
|
@ -113,7 +111,8 @@ class DatabaseConfig
|
|||
$templateConnection = config("database.connections.{$template}");
|
||||
|
||||
return $this->manager()->makeConnectionConfig(
|
||||
array_merge($templateConnection, $this->tenantConfig()), $this->getName()
|
||||
array_merge($templateConnection, $this->tenantConfig()),
|
||||
$this->getName()
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ class UserImpersonation implements Feature
|
|||
*
|
||||
* @param string|ImpersonationToken $token
|
||||
* @param int $ttl
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public static function makeResponse($token, int $ttl = null): RedirectResponse
|
||||
{
|
||||
|
|
|
|||
|
|
@ -29,13 +29,13 @@ class InitializeTenancyByDomain extends IdentificationMiddleware
|
|||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
return $this->initializeTenancy(
|
||||
$request, $next, $request->getHost()
|
||||
$request,
|
||||
$next,
|
||||
$request->getHost()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,8 +13,6 @@ class InitializeTenancyByDomainOrSubdomain
|
|||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -38,7 +38,9 @@ class InitializeTenancyByPath extends IdentificationMiddleware
|
|||
// simply injected into some route controller action.
|
||||
if ($route->parameterNames()[0] === PathTenantResolver::$tenantParameterName) {
|
||||
return $this->initializeTenancy(
|
||||
$request, $next, $route
|
||||
$request,
|
||||
$next,
|
||||
$route
|
||||
);
|
||||
} else {
|
||||
throw new RouteIsMissingTenantParameterException;
|
||||
|
|
|
|||
|
|
@ -36,8 +36,6 @@ class InitializeTenancyByRequestData extends IdentificationMiddleware
|
|||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -28,8 +28,6 @@ class InitializeTenancyBySubdomain extends InitializeTenancyByDomain
|
|||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -75,7 +75,6 @@ abstract class CachedTenantResolver implements TenantResolver
|
|||
/**
|
||||
* Get all the arg combinations for resolve() that can be used to find this tenant.
|
||||
*
|
||||
* @param Tenant $tenant
|
||||
* @return array[]
|
||||
*/
|
||||
abstract public function getArgsForTenant(Tenant $tenant): array;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ class Tenancy
|
|||
/**
|
||||
* Initializes the tenant.
|
||||
* @param Tenant|int|string $tenant
|
||||
* @return void
|
||||
*/
|
||||
public function initialize($tenant): void
|
||||
{
|
||||
|
|
@ -106,9 +105,6 @@ class Tenancy
|
|||
/**
|
||||
* Run a callback in the central context.
|
||||
* Atomic, safely reverts to previous context.
|
||||
*
|
||||
* @param callable $callback
|
||||
* @return mixed
|
||||
*/
|
||||
public function central(callable $callback)
|
||||
{
|
||||
|
|
@ -132,7 +128,6 @@ class Tenancy
|
|||
* More performant than running $tenant->run() one by one.
|
||||
*
|
||||
* @param Tenant[]|\Traversable|string[]|null $tenants
|
||||
* @param callable $callback
|
||||
* @return void
|
||||
*/
|
||||
public function runForMultiple($tenants, callable $callback)
|
||||
|
|
|
|||
|
|
@ -15,8 +15,6 @@ class TenancyServiceProvider extends ServiceProvider
|
|||
{
|
||||
/**
|
||||
* Register services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
|
|
@ -76,8 +74,6 @@ class TenancyServiceProvider extends ServiceProvider
|
|||
|
||||
/**
|
||||
* Bootstrap services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue