1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-13 07:14:04 +00:00

get down to 21 phpstan errors

This commit is contained in:
Samuel Štancl 2022-09-29 23:39:35 +02:00
parent a94227a19c
commit f98a901aeb
16 changed files with 85 additions and 26 deletions

View file

@ -9,5 +9,15 @@ use Stancl\Tenancy\Database\DatabaseConfig;
interface TenantWithDatabase extends Tenant
{
/** Get the tenant's database config. */
public function database(): DatabaseConfig;
/** Get the internal prefix. */
public static function internalPrefix(): string;
/** Get an internal key. */
public function getInternal(string $key): mixed;
/** Set internal key. */
public function setInternal(string $key, mixed $value): static;
}

View file

@ -81,7 +81,7 @@ class DatabaseConfig
*/
public function makeCredentials(): void
{
$this->tenant->setInternal('db_name', $this->getName() ?? (static::$databaseNameGenerator)($this->tenant));
$this->tenant->setInternal('db_name', $this->getName());
if ($this->manager() instanceof Contracts\ManagesDatabaseUsers) {
$this->tenant->setInternal('db_username', $this->getUsername() ?? (static::$usernameGenerator)($this->tenant));