Fix PHPStan parameter type error introduced after update to version 0.12.83
This commit fixes the following PHPStan errors introduced after the update to version 0.12.83: ``` ------ ---------------------------------------------------------------------- Line lib/Newsletter/Renderer/Blocks/Footer.php ------ ---------------------------------------------------------------------- 18 Parameter #1 $html of method MailPoet\Util\pQuery\pQuery::parseStr() expects string, array|string|null given. ------ ---------------------------------------------------------------------- ------ ---------------------------------------------------------------------- Line lib/Newsletter/Renderer/Blocks/Header.php ------ ---------------------------------------------------------------------- 18 Parameter #1 $html of method MailPoet\Util\pQuery\pQuery::parseStr() expects string, array|string|null given. ------ ---------------------------------------------------------------------- ``` [MAILPOET-3491]
This commit is contained in:
@ -14,6 +14,9 @@ class Header {
|
||||
$lineHeight = sprintf(
|
||||
'%spx', StylesHelper::$defaultLineHeight * (int)$element['styles']['text']['fontSize']
|
||||
);
|
||||
if (!is_string($element['text'])) {
|
||||
throw new \RuntimeException('$element[\'text\'] should be a string.');
|
||||
}
|
||||
$dOMParser = new pQuery();
|
||||
$DOM = $dOMParser->parseStr($element['text']);
|
||||
if (isset($element['styles']['link'])) {
|
||||
|
Reference in New Issue
Block a user