diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ca3c21c..5577e6a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,7 @@ Please also have a look at our ### Changed - Use more native type declarations and strict mode - (#641, #772, #774, #778, #804) + (#641, #772, #774, #778, #804, #841) - Add visibility to all class/interface constants (#469) ### Deprecated diff --git a/src/CSSList/CSSList.php b/src/CSSList/CSSList.php index 9ea81b4c..a747e90c 100644 --- a/src/CSSList/CSSList.php +++ b/src/CSSList/CSSList.php @@ -413,7 +413,7 @@ protected function renderListContents(OutputFormat $oOutputFormat) $oNextLevel = $oOutputFormat->nextLevel(); } foreach ($this->aContents as $oContent) { - $sRendered = $oOutputFormat->safely(function () use ($oNextLevel, $oContent) { + $sRendered = $oOutputFormat->safely(static function () use ($oNextLevel, $oContent): string { return $oContent->render($oNextLevel); }); if ($sRendered === null) { diff --git a/src/RuleSet/RuleSet.php b/src/RuleSet/RuleSet.php index 62a3d313..8888e9cd 100644 --- a/src/RuleSet/RuleSet.php +++ b/src/RuleSet/RuleSet.php @@ -162,7 +162,7 @@ public function getRules($mRule = null) $aResult = \array_merge($aResult, $aRules); } } - \usort($aResult, function (Rule $first, Rule $second) { + \usort($aResult, static function (Rule $first, Rule $second): int { if ($first->getLineNo() === $second->getLineNo()) { return $first->getColNo() - $second->getColNo(); } @@ -266,7 +266,7 @@ protected function renderRules(OutputFormat $oOutputFormat) $oNextLevel = $oOutputFormat->nextLevel(); foreach ($this->aRules as $aRules) { foreach ($aRules as $rule) { - $sRendered = $oNextLevel->safely(function () use ($rule, $oNextLevel) { + $sRendered = $oNextLevel->safely(static function () use ($rule, $oNextLevel): string { return $rule->render($oNextLevel); }); if ($sRendered === null) {