Enable strict exception type hint checking in PHPStan and add exception type hints

This commit is contained in:
Alex Cabal 2024-05-10 20:47:36 -05:00
parent 559e4a5e05
commit c4c8e7353f
26 changed files with 300 additions and 82 deletions

View file

@ -89,6 +89,7 @@ class Artist{
* @throws Exceptions\InvalidArtistException
*/
public function Validate(): void{
/** @throws void */
$now = new DateTimeImmutable();
$thisYear = intval($now->format('Y'));
@ -136,6 +137,9 @@ class Artist{
return $result[0] ?? throw new Exceptions\ArtistNotFoundException();;
}
/**
* @throws Exceptions\InvalidArtistException
*/
public function Create(): void{
$this->Validate();
Db::Query('
@ -149,7 +153,7 @@ class Artist{
}
/**
* @throws Exceptions\ValidationException
* @throws Exceptions\InvalidArtistException
*/
public static function GetOrCreate(Artist $artist): Artist{
$result = Db::Query('