mirror of
https://github.com/standardebooks/web.git
synced 2025-07-08 07:40:39 -04:00
Add type hints to Artwork class members
This commit is contained in:
parent
5b6a334dd0
commit
8e37543fa3
5 changed files with 64 additions and 47 deletions
|
@ -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];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue