mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 11:44:04 +00:00
Apply fixes from StyleCI
This commit is contained in:
parent
5d7d208e2f
commit
a3a38ee6d2
5 changed files with 16 additions and 10 deletions
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Stancl\Tenancy\Contracts;
|
namespace Stancl\Tenancy\Contracts;
|
||||||
|
|
||||||
use Stancl\Tenancy\DatabaseConfig;
|
use Stancl\Tenancy\DatabaseConfig;
|
||||||
|
|
@ -7,5 +9,6 @@ use Stancl\Tenancy\DatabaseConfig;
|
||||||
interface ManagesDatabaseUsers
|
interface ManagesDatabaseUsers
|
||||||
{
|
{
|
||||||
public function createUser(DatabaseConfig $databaseConfig): void;
|
public function createUser(DatabaseConfig $databaseConfig): void;
|
||||||
|
|
||||||
public function deleteUser(DatabaseConfig $databaseConfig): void;
|
public function deleteUser(DatabaseConfig $databaseConfig): void;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Stancl\Tenancy;
|
namespace Stancl\Tenancy;
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Hash;
|
use Illuminate\Support\Facades\Hash;
|
||||||
|
|
@ -104,7 +106,7 @@ class DatabaseConfig
|
||||||
// and it doesn't exist, we'll go for the default DB template.
|
// and it doesn't exist, we'll go for the default DB template.
|
||||||
if (! array_key_exists($name, config('database.connections'))) {
|
if (! array_key_exists($name, config('database.connections'))) {
|
||||||
$name = config('tenancy.database.template_connection') ?? DatabaseManager::$originalDefaultConnectionName;
|
$name = config('tenancy.database.template_connection') ?? DatabaseManager::$originalDefaultConnectionName;
|
||||||
};
|
}
|
||||||
|
|
||||||
return $name;
|
return $name;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -160,7 +160,7 @@ class DatabaseManager
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($afterCreating as $item) {
|
foreach ($afterCreating as $item) {
|
||||||
if (is_object($item) && !$item instanceof Closure) {
|
if (is_object($item) && ! $item instanceof Closure) {
|
||||||
$item->handle($tenant);
|
$item->handle($tenant);
|
||||||
} else {
|
} else {
|
||||||
$item($tenant);
|
$item($tenant);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Stancl\Tenancy\TenantDatabaseManagers;
|
namespace Stancl\Tenancy\TenantDatabaseManagers;
|
||||||
|
|
||||||
use Stancl\Tenancy\Contracts\ManagesDatabaseUsers;
|
use Stancl\Tenancy\Contracts\ManagesDatabaseUsers;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Stancl\Tenancy\Tests;
|
namespace Stancl\Tenancy\Tests;
|
||||||
|
|
||||||
class DatabaseUsersTest extends TestCase
|
class DatabaseUsersTest extends TestCase
|
||||||
|
|
@ -7,18 +9,15 @@ class DatabaseUsersTest extends TestCase
|
||||||
/** @test */
|
/** @test */
|
||||||
public function users_are_created_when_permission_controlled_mysql_manager_is_used()
|
public function users_are_created_when_permission_controlled_mysql_manager_is_used()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @test */
|
/** @test */
|
||||||
public function correct_grants_are_given_to_the_users()
|
public function correct_grants_are_given_to_the_users()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @test */
|
/** @test */
|
||||||
public function having_existing_databases_without_users_and_switching_to_permission_controlled_mysql_manager_doesnt_break_existing_dbs()
|
public function having_existing_databases_without_users_and_switching_to_permission_controlled_mysql_manager_doesnt_break_existing_dbs()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue