mirror of
https://github.com/standardebooks/web.git
synced 2025-07-06 14:50:39 -04:00
Enable strict exception type hint checking in PHPStan and add exception type hints
This commit is contained in:
parent
559e4a5e05
commit
c4c8e7353f
26 changed files with 300 additions and 82 deletions
|
@ -1,4 +1,7 @@
|
|||
<?
|
||||
|
||||
use Exceptions\InvalidArtworkTagException;
|
||||
|
||||
use function Safe\preg_match;
|
||||
use function Safe\preg_replace;
|
||||
|
||||
|
@ -20,7 +23,7 @@ class ArtworkTag extends Tag{
|
|||
// *******
|
||||
|
||||
/**
|
||||
* @throws Exceptions\ValidationException
|
||||
* @throws Exceptions\InvalidArtworkTagException
|
||||
*/
|
||||
public function Validate(): void{
|
||||
$error = new Exceptions\InvalidArtworkTagException($this->Name);
|
||||
|
@ -46,6 +49,9 @@ class ArtworkTag extends Tag{
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws InvalidArtworkTagException
|
||||
*/
|
||||
public function Create(): void{
|
||||
$this->Validate();
|
||||
|
||||
|
@ -57,7 +63,7 @@ class ArtworkTag extends Tag{
|
|||
}
|
||||
|
||||
/**
|
||||
* @throws Exceptions\ValidationException
|
||||
* @throws Exceptions\InvalidArtworkTagException
|
||||
*/
|
||||
public static function GetOrCreate(ArtworkTag $artworkTag): ArtworkTag{
|
||||
$result = Db::Query('
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue