diff --git a/src/RuleSet/DeclarationBlock.php b/src/RuleSet/DeclarationBlock.php index 91f5ecef..e51e782f 100644 --- a/src/RuleSet/DeclarationBlock.php +++ b/src/RuleSet/DeclarationBlock.php @@ -735,7 +735,7 @@ public function createFontShorthand() if (!isset($aRules['font-size']) || !isset($aRules['font-family'])) { return; } - $oOldRule = isset($aRules['font-size']) ? $aRules['font-size'] : $aRules['font-family']; + $oOldRule = $aRules['font-size'] ?? $aRules['font-family']; $oNewRule = new Rule('font', $oOldRule->getLineNo(), $oOldRule->getColNo()); unset($oOldRule); foreach (['font-style', 'font-variant', 'font-weight'] as $sProperty) { diff --git a/src/Value/Size.php b/src/Value/Size.php index f8336b1f..0ef3e6ac 100644 --- a/src/Value/Size.php +++ b/src/Value/Size.php @@ -219,6 +219,6 @@ public function render(OutputFormat $oOutputFormat) $sSize = preg_match("/[\d\.]+e[+-]?\d+/i", (string) $this->fSize) ? preg_replace("/$sPoint?0+$/", "", sprintf("%f", $this->fSize)) : $this->fSize; return preg_replace(["/$sPoint/", "/^(-?)0\./"], ['.', '$1.'], $sSize) - . ($this->sUnit === null ? '' : $this->sUnit); + . ($this->sUnit ?? ''); } }