Browse Source

chore: bump PHPStan (#8245)

Dariusz Rumiński 5 months ago
parent
commit
daab03a5f4
5 changed files with 615 additions and 113 deletions
  1. 6 1
      composer.json
  2. 6 5
      dev-tools/composer.json
  3. 603 75
      dev-tools/composer.lock
  4. 0 30
      dev-tools/phpstan/baseline.php
  5. 0 2
      src/Tokenizer/Token.php

+ 6 - 1
composer.json

@@ -113,6 +113,10 @@
             "@composer normalize --working-dir=dev-tools --dry-run ../composer.json",
             "@composer normalize --working-dir=dev-tools --dry-run composer.json"
         ],
+        "normalize:fix": [
+            "@composer normalize --working-dir=dev-tools ../composer.json",
+            "@composer normalize --working-dir=dev-tools composer.json"
+        ],
         "phpstan": "@php -d memory_limit=512M dev-tools/vendor/bin/phpstan analyse",
         "phpstan:baseline": "@php -d memory_limit=512M dev-tools/vendor/bin/phpstan analyse --generate-baseline=./dev-tools/phpstan/baseline.php",
         "qa": "@quality-assurance",
@@ -179,7 +183,8 @@
         "infection": "Alias for 'test:mutation'",
         "install-tools": "Install DEV tools",
         "mess-detector": "Analyse code with Mess Detector",
-        "normalize": "Run normalization for composer.json files",
+        "normalize": "Check normalization for composer.json files",
+        "normalize:fix": "Run normalization for composer.json files",
         "phpstan": "Run PHPStan analysis",
         "phpstan:baseline": "Dump PHPStan baseline file - use only for updating, do not add new errors when possible",
         "post-autoload-dump": "Run additional tasks after installing/updating main dependencies",

+ 6 - 5
dev-tools/composer.json

@@ -1,15 +1,16 @@
 {
+    "type": "project",
     "require": {
         "php": "^8.3",
-        "ergebnis/composer-normalize": "^2.43.0",
+        "ergebnis/composer-normalize": "^2.44.0",
         "icanhazstring/composer-unused": "^0.8.11",
-        "maglnet/composer-require-checker": "^4.11.0",
+        "maglnet/composer-require-checker": "^4.12.0",
         "mi-schi/phpmd-extension": "^4.3.0",
         "phpmd/phpmd": "^2.15.0",
-        "phpstan/extension-installer": "^1.4.1",
-        "phpstan/phpstan": "^1.12.3",
+        "phpstan/extension-installer": "^1.4.3",
+        "phpstan/phpstan": "^1.12.6",
         "phpstan/phpstan-phpunit": "^1.4.0",
-        "phpstan/phpstan-strict-rules": "^1.6.0"
+        "phpstan/phpstan-strict-rules": "^1.6.1"
     },
     "config": {
         "allow-plugins": {

File diff suppressed because it is too large
+ 603 - 75
dev-tools/composer.lock


+ 0 - 30
dev-tools/phpstan/baseline.php

@@ -697,36 +697,6 @@ $ignoreErrors[] = [
 	'count' => 5,
 	'path' => __DIR__ . '/../../src/Fixer/Basic/NumericLiteralSeparatorFixer.php',
 ];
-$ignoreErrors[] = [
-	// identifier: offsetAccess.notFound
-	'message' => '#^Offset 1 might not exist on array\\<list\\<string\\>\\>\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/../../src/Fixer/Basic/NumericLiteralSeparatorFixer.php',
-];
-$ignoreErrors[] = [
-	// identifier: offsetAccess.notFound
-	'message' => '#^Offset 3 might not exist on array\\<list\\<string\\>\\>\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/../../src/Fixer/Basic/NumericLiteralSeparatorFixer.php',
-];
-$ignoreErrors[] = [
-	// identifier: offsetAccess.notFound
-	'message' => '#^Offset 4 might not exist on array\\<list\\<string\\>\\>\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/../../src/Fixer/Basic/NumericLiteralSeparatorFixer.php',
-];
-$ignoreErrors[] = [
-	// identifier: offsetAccess.notFound
-	'message' => '#^Offset 6 might not exist on array\\<list\\<string\\>\\>\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/../../src/Fixer/Basic/NumericLiteralSeparatorFixer.php',
-];
-$ignoreErrors[] = [
-	// identifier: offsetAccess.notFound
-	'message' => '#^Offset 7 might not exist on array\\<list\\<string\\>\\>\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/../../src/Fixer/Basic/NumericLiteralSeparatorFixer.php',
-];
 $ignoreErrors[] = [
 	// identifier: argument.type
 	'message' => '#^Parameter \\#1 \\$string of function strlen expects string, string\\|false given\\.$#',

+ 0 - 2
src/Tokenizer/Token.php

@@ -300,8 +300,6 @@ final class Token
 
         $name = token_name($id);
 
-        \assert('' !== $name);
-
         return 'UNKNOWN' === $name ? null : $name;
     }
 

Some files were not shown because too many files changed in this diff