mirror of
https://github.com/standardebooks/web.git
synced 2025-07-07 07:10:29 -04:00
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:
parent
88b3ffd9ed
commit
f736c20e3b
1 changed files with 2 additions and 2 deletions
|
@ -583,11 +583,11 @@ class Ebook{
|
|||
public function Validate(): void{
|
||||
$error = new Exceptions\ValidationException();
|
||||
|
||||
if($this->Identifier === null || $this->Identifier == ''){
|
||||
if($this->Identifier == ''){
|
||||
$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'));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue