1
0
Fork 0
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:
Abrar Ahmad 2022-09-20 11:14:51 +05:00
parent f3898e7224
commit 6e513c49f4

View file

@ -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);
}
}