Просмотр исходного кода

DX: update `phpstan/phpstan-strict-rules` (#7924)

Kuba Werłos 11 месяцев назад
Родитель
Сommit
87c75fa569

+ 1 - 1
dev-tools/composer.json

@@ -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": {

+ 6 - 6
dev-tools/composer.lock

@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "22e72b75647e3e8f221e9e49ef0d9331",
+    "content-hash": "bd69a6a98e184d34c5c2923fa51a5695",
     "packages": [
         {
             "name": "composer-unused/contracts",
@@ -781,20 +781,20 @@
         },
         {
             "name": "phpstan/phpstan-strict-rules",
-            "version": "1.5.2",
+            "version": "1.5.3",
             "source": {
                 "type": "git",
                 "url": "https://github.com/phpstan/phpstan-strict-rules.git",
-                "reference": "7a50e9662ee9f3942e4aaaf3d603653f60282542"
+                "reference": "568210bd301f94a0d4b1e5a0808c374c1b9cf11b"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/7a50e9662ee9f3942e4aaaf3d603653f60282542",
-                "reference": "7a50e9662ee9f3942e4aaaf3d603653f60282542"
+                "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/568210bd301f94a0d4b1e5a0808c374c1b9cf11b",
+                "reference": "568210bd301f94a0d4b1e5a0808c374c1b9cf11b"
             },
             "require": {
                 "php": "^7.2 || ^8.0",
-                "phpstan/phpstan": "^1.10.34"
+                "phpstan/phpstan": "^1.10.60"
             },
             "type": "phpstan-extension",
             "extra": {

+ 10 - 7
src/Documentation/FixerDocumentGenerator.php

@@ -125,13 +125,16 @@ final class FixerDocumentGenerator
             }
 
             $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) {

+ 4 - 1
src/RuleSet/RuleSet.php

@@ -108,7 +108,10 @@ final class RuleSet implements RuleSetInterface
         }
 
         // filter out all resolvedRules that are off
-        $resolvedRules = array_filter($resolvedRules);
+        $resolvedRules = array_filter(
+            $resolvedRules,
+            static fn ($value): bool => false !== $value
+        );
 
         $this->rules = $resolvedRules;
     }