1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 08:14:02 +00:00

Apply fixes from StyleCI

This commit is contained in:
stancl 2020-04-28 19:08:21 +00:00 committed by StyleCI Bot
parent 37242279fe
commit bd8296d206
9 changed files with 15 additions and 14 deletions

View file

@ -1,5 +1,7 @@
<?php <?php
declare(strict_types=1);
namespace Stancl\Tenancy\Contracts; namespace Stancl\Tenancy\Contracts;
use Stancl\Tenancy\Contracts\Future\CanSetConnection; use Stancl\Tenancy\Contracts\Future\CanSetConnection;

View file

@ -33,9 +33,8 @@ interface TenantDatabaseManager
*/ */
public function databaseExists(string $name): bool; public function databaseExists(string $name): bool;
/** /**
* Override the base connection * Override the base connection.
* *
* @param Tenant $tenant * @param Tenant $tenant
* @param array $baseConfiguration * @param array $baseConfiguration

View file

@ -9,7 +9,6 @@ use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Database\DatabaseManager as BaseDatabaseManager; use Illuminate\Database\DatabaseManager as BaseDatabaseManager;
use Illuminate\Foundation\Application; use Illuminate\Foundation\Application;
use Stancl\Tenancy\Contracts\Future\CanSetConnection; use Stancl\Tenancy\Contracts\Future\CanSetConnection;
use Stancl\Tenancy\Contracts\ManagesDatabaseUsers;
use Stancl\Tenancy\Contracts\TenantCannotBeCreatedException; use Stancl\Tenancy\Contracts\TenantCannotBeCreatedException;
use Stancl\Tenancy\Contracts\TenantDatabaseManager; use Stancl\Tenancy\Contracts\TenantDatabaseManager;
use Stancl\Tenancy\Exceptions\DatabaseManagerNotRegisteredException; use Stancl\Tenancy\Exceptions\DatabaseManagerNotRegisteredException;
@ -254,7 +253,7 @@ class DatabaseManager
} }
/** /**
* Get the connection base configuration for a tenant * Get the connection base configuration for a tenant.
* *
* @param Tenant $tenant * @param Tenant $tenant
* @return array * @return array

View file

@ -50,7 +50,7 @@ class MySQLDatabaseManager implements TenantDatabaseManager, CanSetConnection
} }
/** /**
* @inheritDoc * {@inheritdoc}
*/ */
public function createDatabaseConnection(Tenant $tenant, array $baseConfiguration): array public function createDatabaseConnection(Tenant $tenant, array $baseConfiguration): array
{ {

View file

@ -1,10 +1,9 @@
<?php <?php
declare(strict_types=1);
namespace Stancl\Tenancy\TenantDatabaseManagers; namespace Stancl\Tenancy\TenantDatabaseManagers;
use Illuminate\Contracts\Config\Repository;
use Illuminate\Support\Str;
use Stancl\Tenancy\Contracts\DatabaseUserGenerator;
use Stancl\Tenancy\Contracts\ManagesDatabaseUsers; use Stancl\Tenancy\Contracts\ManagesDatabaseUsers;
use Stancl\Tenancy\Tenant; use Stancl\Tenancy\Tenant;
@ -28,7 +27,7 @@ class PermissionControlledMySQLDatabaseManager extends MySQLDatabaseManager impl
'username' => $tenant->getDatabaseUsername(), 'username' => $tenant->getDatabaseUsername(),
'password' => $tenant->getDatabasePassword(), 'password' => $tenant->getDatabasePassword(),
'port' => $tenant->getDatabasePort(), 'port' => $tenant->getDatabasePort(),
'url' => $tenant->getDatabaseUrl() 'url' => $tenant->getDatabaseUrl(),
]) ])
); );
} }
@ -53,7 +52,7 @@ class PermissionControlledMySQLDatabaseManager extends MySQLDatabaseManager impl
'_tenancy_db_username' => $username, '_tenancy_db_username' => $username,
'_tenancy_db_password' => $password, '_tenancy_db_password' => $password,
'_tenancy_db_host' => $appHost, '_tenancy_db_host' => $appHost,
'_tenancy_db_link' => $tenant->getDatabaseLink() '_tenancy_db_link' => $tenant->getDatabaseLink(),
])->save(); ])->save();
} }

View file

@ -47,7 +47,7 @@ class PostgreSQLDatabaseManager implements TenantDatabaseManager, CanSetConnecti
} }
/** /**
* @inheritDoc * {@inheritdoc}
*/ */
public function createDatabaseConnection(Tenant $tenant, array $baseConfiguration): array public function createDatabaseConnection(Tenant $tenant, array $baseConfiguration): array
{ {
@ -56,7 +56,7 @@ class PostgreSQLDatabaseManager implements TenantDatabaseManager, CanSetConnecti
} }
return array_replace_recursive($baseConfiguration, [ return array_replace_recursive($baseConfiguration, [
'database' => $tenant->getDatabaseName() 'database' => $tenant->getDatabaseName(),
]); ]);
} }
} }

View file

@ -53,7 +53,7 @@ class PostgreSQLSchemaManager implements TenantDatabaseManager, CanSetConnection
} }
return array_replace_recursive($baseConfiguration, [ return array_replace_recursive($baseConfiguration, [
'schema' => $tenant->getDatabaseName() 'schema' => $tenant->getDatabaseName(),
]); ]);
} }
} }

View file

@ -35,7 +35,7 @@ class SQLiteDatabaseManager implements TenantDatabaseManager
public function createDatabaseConnection(Tenant $tenant, array $baseConfiguration): array public function createDatabaseConnection(Tenant $tenant, array $baseConfiguration): array
{ {
return array_replace_recursive($baseConfiguration, [ return array_replace_recursive($baseConfiguration, [
'database' => database_path($tenant->getDatabaseName()) 'database' => database_path($tenant->getDatabaseName()),
]); ]);
} }
} }

View file

@ -1,5 +1,7 @@
<?php <?php
declare(strict_types=1);
namespace Stancl\Tenancy\Traits; namespace Stancl\Tenancy\Traits;
use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Hash;