mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 14:54:03 +00:00
refactor the ternary into if condition
This commit is contained in:
parent
f3898e7224
commit
6e513c49f4
1 changed files with 10 additions and 1 deletions
|
|
@ -10,6 +10,9 @@ use Throwable;
|
|||
|
||||
class SQLiteDatabaseManager implements TenantDatabaseManager
|
||||
{
|
||||
/**
|
||||
* SQLite Database path without ending slash.
|
||||
*/
|
||||
public static string|null $path = null;
|
||||
|
||||
public function createDatabase(TenantWithDatabase $tenant): bool
|
||||
|
|
@ -49,6 +52,12 @@ class SQLiteDatabaseManager implements TenantDatabaseManager
|
|||
|
||||
public function getPath(string $name): string
|
||||
{
|
||||
return static::$path ? static::$path . '/' . $name : database_path($name);
|
||||
if (static::$path) {
|
||||
// The path is set, so return the full path with the database name
|
||||
return str(static::$path)->append(DIRECTORY_SEPARATOR)->append($name)->toString();
|
||||
}
|
||||
|
||||
// The path is not set so return the default path
|
||||
return database_path($name);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue