mirror of
https://github.com/standardebooks/web.git
synced 2025-07-14 10:31:59 -04:00
Style tweaks for getters and add more type hinting
This commit is contained in:
parent
9e31ed1aac
commit
50efeb05d1
13 changed files with 87 additions and 84 deletions
|
@ -560,6 +560,10 @@ class Museum extends Accessor{
|
|||
return $outputUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws Exceptions\MuseumNotFoundException
|
||||
* @throws Exceptions\InvalidUrlException
|
||||
*/
|
||||
public static function GetByUrl(?string $url): Museum{
|
||||
if($url === null){
|
||||
throw new Exceptions\MuseumNotFoundException();
|
||||
|
@ -583,10 +587,6 @@ class Museum extends Accessor{
|
|||
limit 1;
|
||||
', [$parsedUrl['host']], 'Museum');
|
||||
|
||||
if(sizeof($result) == 0){
|
||||
throw new Exceptions\MuseumNotFoundException();
|
||||
}
|
||||
|
||||
return $result[0];
|
||||
return $result[0] ?? throw new Exceptions\MuseumNotFoundException();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue