fix: update database property type to nullable and handle defaults in fromArray method

This commit is contained in:
ArnabChatterjee20k committed 2026-03-19 13:18:51 +05:30
1 parent 95dcbb9c09
commit a5cebfaffa
1 file changed
+3 -3
@@ -26,7 +26,7 @@ class Database extends Resource
protected bool $enabled = true,
protected string $originalId = '',
protected string $type = '',
protected string $database = ''
protected ?string $database = ''
) {
$this->id = $id;
}
@@ -52,7 +52,7 @@ class Database extends Resource
enabled: $array['enabled'] ?? true,
originalId: $array['originalId'] ?? '',
type: $array['type'] ?? 'legacy',
database: $array['database']
database: $array['database'] ?? null
);
}
@@ -97,7 +97,7 @@ class Database extends Resource
return $this->type;
}
public function getDatabase(): string
public function getDatabase(): mixed
{
return $this->database;
}