|
public function setHTML(?string $html): void |
|
{ |
|
if (preg_match('//u', $html) !== 1) { |
|
throw new InvalidArgumentException("message body contains an invalid UTF-8 byte sequence"); |
|
} |
This will trigger a deprecation warning if null is passed because
preg_match only accepts strings as of PHP 8.
Error: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated