Fix error found by PHPStan

PHPStan doesn't think that Identifier can be null:

```
549    Strict comparison using === between string and null will always evaluate to false.
```
This commit is contained in:
Mike Colagrosso 2024-04-21 23:50:57 -06:00 committed by Alex Cabal
parent 88b3ffd9ed
commit f736c20e3b

View file

@ -583,11 +583,11 @@ class Ebook{
public function Validate(): void{ public function Validate(): void{
$error = new Exceptions\ValidationException(); $error = new Exceptions\ValidationException();
if($this->Identifier === null || $this->Identifier == ''){ if($this->Identifier == ''){
$error->Add(new Exceptions\EbookIdentifierRequiredException()); $error->Add(new Exceptions\EbookIdentifierRequiredException());
} }
if($this->Identifier !== null && strlen($this->Identifier) > EBOOKS_MAX_STRING_LENGTH){ if(strlen($this->Identifier) > EBOOKS_MAX_STRING_LENGTH){
$error->Add(new Exceptions\StringTooLongException('Ebook Identifier')); $error->Add(new Exceptions\StringTooLongException('Ebook Identifier'));
} }