public function setTitle(?string $title): self
{
if (\grapheme_strlen($title) > 255) {
throw new RequestValidationException(\sprintf('Invalid %s value. Given: `%s`. Length should be less than 255.', 'title', $title));
}
$this->title = $title;
$this->optionalPropertyChanged['title'] = true;
return $this;
}
When $title argument is null then PHP 8.1 triggers an error.
A solution would be to check if the $title is not null before applying validation.
The following snipped
Produces:
When $title argument is null then PHP 8.1 triggers an error.
A solution would be to check if the $title is not null before applying validation.