Add type hints to Artwork class members

This commit is contained in:
Alex Cabal 2024-01-08 14:06:25 -06:00
parent 5b6a334dd0
commit 8e37543fa3
5 changed files with 64 additions and 47 deletions

View file

@ -5,7 +5,11 @@ class Museum extends PropertiesBase{
public $Name;
public $Domain;
public static function GetByUrl(string $url): ?Museum{
public static function GetByUrl(?string $url): Museum{
if($url === null){
throw new Exceptions\MuseumNotFoundException();
}
$result = Db::Query('
SELECT *
from Museums
@ -13,6 +17,10 @@ class Museum extends PropertiesBase{
limit 1;
', [$url], 'Museum');
return $result[0] ?? null;
if($result[0] === null){
throw new Exceptions\MuseumNotFoundException();
}
return $result[0];
}
}