Skip to content

Commit

Permalink
DX: update phpstan/phpstan-strict-rules (#7924)
Browse files Browse the repository at this point in the history
  • Loading branch information
kubawerlos authored Apr 7, 2024
1 parent c7f60ee commit 87c75fa
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 15 deletions.
2 changes: 1 addition & 1 deletion dev-tools/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"phpstan/extension-installer": "^1.3.1",
"phpstan/phpstan": "^1.10.62",
"phpstan/phpstan-phpunit": "^1.3.16",
"phpstan/phpstan-strict-rules": "^1.5.2"
"phpstan/phpstan-strict-rules": "^1.5.3"
},
"config": {
"allow-plugins": {
Expand Down
12 changes: 6 additions & 6 deletions dev-tools/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 10 additions & 7 deletions src/Documentation/FixerDocumentGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,16 @@ public function generateFixerDocumentation(FixerInterface $fixer): string
}

$warningsHeaderLine = str_repeat('-', \strlen($warningsHeader));
$doc .= "\n\n".implode("\n", array_filter([
$warningsHeader,
$warningsHeaderLine,
$deprecationDescription,
$experimentalDescription,
$riskyDescription,
]));
$doc .= "\n\n".implode("\n", array_filter(
[
$warningsHeader,
$warningsHeaderLine,
$deprecationDescription,
$experimentalDescription,
$riskyDescription,
],
static fn (string $text): bool => '' !== $text
));
}

if ($fixer instanceof ConfigurableFixerInterface) {
Expand Down
5 changes: 4 additions & 1 deletion src/RuleSet/RuleSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ private function resolveSet(array $rules): void
}

// filter out all resolvedRules that are off
$resolvedRules = array_filter($resolvedRules);
$resolvedRules = array_filter(
$resolvedRules,
static fn ($value): bool => false !== $value
);

$this->rules = $resolvedRules;
}
Expand Down

0 comments on commit 87c75fa

Please sign in to comment.