mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 22:54:03 +00:00
get down to 59 phpstan errors
This commit is contained in:
parent
193e044777
commit
a94227a19c
26 changed files with 130 additions and 130 deletions
|
|
@ -26,20 +26,20 @@ class DatabaseConfig
|
|||
|
||||
public static function __constructStatic(): void
|
||||
{
|
||||
static::$usernameGenerator = static::$usernameGenerator ?? function (Tenant $tenant) {
|
||||
static::$usernameGenerator = static::$usernameGenerator ?? function (Model&Tenant $tenant) {
|
||||
return Str::random(16);
|
||||
};
|
||||
|
||||
static::$passwordGenerator = static::$passwordGenerator ?? function (Tenant $tenant) {
|
||||
static::$passwordGenerator = static::$passwordGenerator ?? function (Model&Tenant $tenant) {
|
||||
return Hash::make(Str::random(32));
|
||||
};
|
||||
|
||||
static::$databaseNameGenerator = static::$databaseNameGenerator ?? function (Tenant $tenant) {
|
||||
static::$databaseNameGenerator = static::$databaseNameGenerator ?? function (Model&Tenant $tenant) {
|
||||
return config('tenancy.database.prefix') . $tenant->getTenantKey() . config('tenancy.database.suffix');
|
||||
};
|
||||
}
|
||||
|
||||
public function __construct(Tenant $tenant)
|
||||
public function __construct(Model&Tenant $tenant)
|
||||
{
|
||||
static::__constructStatic();
|
||||
|
||||
|
|
@ -61,7 +61,7 @@ class DatabaseConfig
|
|||
static::$passwordGenerator = $passwordGenerator;
|
||||
}
|
||||
|
||||
public function getName(): ?string
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->tenant->getInternal('db_name') ?? (static::$databaseNameGenerator)($this->tenant);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue