mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 05:24:03 +00:00
general refactor, move more classes under Database namespace
This commit is contained in:
parent
2d7e9dfd89
commit
40bf28c7d0
41 changed files with 122 additions and 133 deletions
|
|
@ -1,13 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Stancl\Tenancy\Exceptions;
|
||||
|
||||
class DatabaseManagerNotRegisteredException extends \Exception
|
||||
{
|
||||
public function __construct($driver)
|
||||
{
|
||||
parent::__construct("Database manager for driver $driver is not registered.");
|
||||
}
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Stancl\Tenancy\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
||||
class NoConnectionSetException extends Exception
|
||||
{
|
||||
public function __construct($manager)
|
||||
{
|
||||
parent::__construct("No connection was set on this $manager instance.");
|
||||
}
|
||||
}
|
||||
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
declare(strict_types=1);
|
||||
|
||||
// todo perhaps create Identification namespace
|
||||
|
||||
namespace Stancl\Tenancy\Exceptions;
|
||||
|
||||
use Stancl\Tenancy\Contracts\TenantCouldNotBeIdentifiedException;
|
||||
|
|
|
|||
|
|
@ -1,21 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Stancl\Tenancy\Exceptions;
|
||||
|
||||
use Stancl\Tenancy\Contracts\TenantCannotBeCreatedException;
|
||||
|
||||
class TenantDatabaseAlreadyExistsException extends TenantCannotBeCreatedException
|
||||
{
|
||||
public function __construct(
|
||||
protected string $database,
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function reason(): string
|
||||
{
|
||||
return "Database {$this->database} already exists.";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Stancl\Tenancy\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
||||
class TenantDatabaseDoesNotExistException extends Exception
|
||||
{
|
||||
public function __construct(string $database)
|
||||
{
|
||||
parent::__construct("Database $database does not exist.");
|
||||
}
|
||||
}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Stancl\Tenancy\Exceptions;
|
||||
|
||||
use Stancl\Tenancy\Contracts\TenantCannotBeCreatedException;
|
||||
|
||||
class TenantDatabaseUserAlreadyExistsException extends TenantCannotBeCreatedException
|
||||
{
|
||||
public function __construct(
|
||||
protected string $user,
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function reason(): string
|
||||
{
|
||||
return "Database user {$this->user} already exists.";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue