Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[TASK] Add native type declarations for anonymous functions
Also make then static if possible.
  • Loading branch information
oliverklee committed Jan 28, 2025
commit ec9dd537a2060785d42695a67b970fb1c7bd6649
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/CSSList/CSSList.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(function () use ($oNextLevel, $oContent): string {
return $oContent->render($oNextLevel);
});
if ($sRendered === null) {
Expand Down
4 changes: 2 additions & 2 deletions src/RuleSet/RuleSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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(function () use ($rule, $oNextLevel): string {
return $rule->render($oNextLevel);
});
if ($sRendered === null) {
Expand Down