Skip to content

Commit 694d510

Browse files
committed
[TASK] Add native type declarations for anonymous functions
Also make then static if possible.
1 parent c6cfc2e commit 694d510

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Please also have a look at our
1919
### Changed
2020

2121
- Use more native type declarations and strict mode
22-
(#641, #772, #774, #778, #804)
22+
(#641, #772, #774, #778, #804, #841)
2323
- Add visibility to all class/interface constants (#469)
2424

2525
### Deprecated

src/CSSList/CSSList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ protected function renderListContents(OutputFormat $oOutputFormat)
413413
$oNextLevel = $oOutputFormat->nextLevel();
414414
}
415415
foreach ($this->aContents as $oContent) {
416-
$sRendered = $oOutputFormat->safely(function () use ($oNextLevel, $oContent) {
416+
$sRendered = $oOutputFormat->safely(function () use ($oNextLevel, $oContent): string {
417417
return $oContent->render($oNextLevel);
418418
});
419419
if ($sRendered === null) {

src/RuleSet/RuleSet.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public function getRules($mRule = null)
165165
$aResult = \array_merge($aResult, $aRules);
166166
}
167167
}
168-
\usort($aResult, function (Rule $first, Rule $second) {
168+
\usort($aResult, static function (Rule $first, Rule $second): int {
169169
if ($first->getLineNo() === $second->getLineNo()) {
170170
return $first->getColNo() - $second->getColNo();
171171
}
@@ -269,7 +269,7 @@ protected function renderRules(OutputFormat $oOutputFormat)
269269
$oNextLevel = $oOutputFormat->nextLevel();
270270
foreach ($this->aRules as $aRules) {
271271
foreach ($aRules as $rule) {
272-
$sRendered = $oNextLevel->safely(function () use ($rule, $oNextLevel) {
272+
$sRendered = $oNextLevel->safely(function () use ($rule, $oNextLevel): string {
273273
return $rule->render($oNextLevel);
274274
});
275275
if ($sRendered === null) {

0 commit comments

Comments
 (0)