The expression return $this->validationResult->getError() could return the type null which is incompatible with the type-hinted return string. Consider adding an additional type-check to rule them out.
Loading history...
44
}
45
46
/**
47
* Get the validation errors
48
*
49
* @return string[]
50
*/
51
1
public function getErrors(): array
52
{
53
1
return $this->validationResult->getErrors();
54
}
55
56
57
/**
58
* Factory method for failed validation
59
*/
60
1
public static function error(string $message, mixed ...$args): static