mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 10:54:04 +00:00
Apply fixes from StyleCI
This commit is contained in:
parent
37242279fe
commit
bd8296d206
9 changed files with 15 additions and 14 deletions
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Stancl\Tenancy\Contracts;
|
||||
|
||||
use Stancl\Tenancy\Contracts\Future\CanSetConnection;
|
||||
|
|
|
|||
|
|
@ -33,9 +33,8 @@ interface TenantDatabaseManager
|
|||
*/
|
||||
public function databaseExists(string $name): bool;
|
||||
|
||||
|
||||
/**
|
||||
* Override the base connection
|
||||
* Override the base connection.
|
||||
*
|
||||
* @param Tenant $tenant
|
||||
* @param array $baseConfiguration
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ use Illuminate\Contracts\Queue\ShouldQueue;
|
|||
use Illuminate\Database\DatabaseManager as BaseDatabaseManager;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Stancl\Tenancy\Contracts\Future\CanSetConnection;
|
||||
use Stancl\Tenancy\Contracts\ManagesDatabaseUsers;
|
||||
use Stancl\Tenancy\Contracts\TenantCannotBeCreatedException;
|
||||
use Stancl\Tenancy\Contracts\TenantDatabaseManager;
|
||||
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
|
||||
* @return array
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class MySQLDatabaseManager implements TenantDatabaseManager, CanSetConnection
|
|||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function createDatabaseConnection(Tenant $tenant, array $baseConfiguration): array
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
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\Tenant;
|
||||
|
||||
|
|
@ -28,7 +27,7 @@ class PermissionControlledMySQLDatabaseManager extends MySQLDatabaseManager impl
|
|||
'username' => $tenant->getDatabaseUsername(),
|
||||
'password' => $tenant->getDatabasePassword(),
|
||||
'port' => $tenant->getDatabasePort(),
|
||||
'url' => $tenant->getDatabaseUrl()
|
||||
'url' => $tenant->getDatabaseUrl(),
|
||||
])
|
||||
);
|
||||
}
|
||||
|
|
@ -53,7 +52,7 @@ class PermissionControlledMySQLDatabaseManager extends MySQLDatabaseManager impl
|
|||
'_tenancy_db_username' => $username,
|
||||
'_tenancy_db_password' => $password,
|
||||
'_tenancy_db_host' => $appHost,
|
||||
'_tenancy_db_link' => $tenant->getDatabaseLink()
|
||||
'_tenancy_db_link' => $tenant->getDatabaseLink(),
|
||||
])->save();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ class PostgreSQLDatabaseManager implements TenantDatabaseManager, CanSetConnecti
|
|||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function createDatabaseConnection(Tenant $tenant, array $baseConfiguration): array
|
||||
{
|
||||
|
|
@ -56,7 +56,7 @@ class PostgreSQLDatabaseManager implements TenantDatabaseManager, CanSetConnecti
|
|||
}
|
||||
|
||||
return array_replace_recursive($baseConfiguration, [
|
||||
'database' => $tenant->getDatabaseName()
|
||||
'database' => $tenant->getDatabaseName(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class PostgreSQLSchemaManager implements TenantDatabaseManager, CanSetConnection
|
|||
}
|
||||
|
||||
return array_replace_recursive($baseConfiguration, [
|
||||
'schema' => $tenant->getDatabaseName()
|
||||
'schema' => $tenant->getDatabaseName(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class SQLiteDatabaseManager implements TenantDatabaseManager
|
|||
public function createDatabaseConnection(Tenant $tenant, array $baseConfiguration): array
|
||||
{
|
||||
return array_replace_recursive($baseConfiguration, [
|
||||
'database' => database_path($tenant->getDatabaseName())
|
||||
'database' => database_path($tenant->getDatabaseName()),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Stancl\Tenancy\Traits;
|
||||
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue