Browse Source

chore: few SCA fixes and dev-tools update (#7969)

Dariusz Rumiński 10 months ago
parent
commit
deb34af241

+ 4 - 4
dev-tools/composer.json

@@ -1,15 +1,15 @@
 {
     "require": {
         "php": "^8.3",
-        "ergebnis/composer-normalize": "^2.24.1",
+        "ergebnis/composer-normalize": "^2.42.0",
         "icanhazstring/composer-unused": "^0.8.11",
-        "maglnet/composer-require-checker": "^4.8.0",
+        "maglnet/composer-require-checker": "^4.11.0",
         "mi-schi/phpmd-extension": "^4.3.0",
         "phpmd/phpmd": "^2.15.0",
         "phpstan/extension-installer": "^1.3.1",
-        "phpstan/phpstan": "^1.10.62",
+        "phpstan/phpstan": "^1.10.67",
         "phpstan/phpstan-phpunit": "^1.3.16",
-        "phpstan/phpstan-strict-rules": "^1.5.3"
+        "phpstan/phpstan-strict-rules": "^1.5.5"
     },
     "config": {
         "allow-plugins": {

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


+ 2 - 22
dev-tools/phpstan/baseline.php

@@ -782,7 +782,7 @@ $ignoreErrors[] = [
 	'path' => __DIR__ . '/../../src/Fixer/PhpUnit/PhpUnitTestAnnotationFixer.php',
 ];
 $ignoreErrors[] = [
-	'message' => '#^Only numeric types are allowed in \\+, int\\|false given on the left side\\.$#',
+	'message' => '#^Only numeric types are allowed in \\+, int\\<0, max\\>\\|false given on the left side\\.$#',
 	'count' => 1,
 	'path' => __DIR__ . '/../../src/Fixer/PhpUnit/PhpUnitTestAnnotationFixer.php',
 ];
@@ -1046,11 +1046,6 @@ $ignoreErrors[] = [
 	'count' => 1,
 	'path' => __DIR__ . '/../../src/Tokenizer/Token.php',
 ];
-$ignoreErrors[] = [
-	'message' => '#^Method PhpCsFixer\\\\Tokenizer\\\\Token\\:\\:getTokenKindsForNames\\(\\) should return array\\<int, int\\> but returns array\\<int\\|string, mixed\\>\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/../../src/Tokenizer/Token.php',
-];
 $ignoreErrors[] = [
 	'message' => '#^Method PhpCsFixer\\\\Tokenizer\\\\Token\\:\\:toJson\\(\\) should return string but returns string\\|false\\.$#',
 	'count' => 1,
@@ -1207,7 +1202,7 @@ $ignoreErrors[] = [
 	'path' => __DIR__ . '/../../tests/AutoReview/ProjectCodeTest.php',
 ];
 $ignoreErrors[] = [
-	'message' => '#^Only booleans are allowed in &&, int\\|false given on the right side\\.$#',
+	'message' => '#^Only booleans are allowed in &&, int\\<0, max\\>\\|false given on the right side\\.$#',
 	'count' => 1,
 	'path' => __DIR__ . '/../../tests/AutoReview/ProjectCodeTest.php',
 ];
@@ -1301,21 +1296,6 @@ $ignoreErrors[] = [
 	'count' => 1,
 	'path' => __DIR__ . '/../../tests/Console/Output/Progress/ProgressOutputFactoryTest.php',
 ];
-$ignoreErrors[] = [
-	'message' => '#^Static property PhpCsFixer\\\\Tests\\\\Console\\\\Report\\\\FixReport\\\\CheckstyleReporterTest\\:\\:\\$xsd \\(string\\|null\\) does not accept string\\|false\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/../../tests/Console/Report/FixReport/CheckstyleReporterTest.php',
-];
-$ignoreErrors[] = [
-	'message' => '#^Static property PhpCsFixer\\\\Tests\\\\Console\\\\Report\\\\FixReport\\\\JunitReporterTest\\:\\:\\$xsd \\(string\\|null\\) does not accept string\\|false\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/../../tests/Console/Report/FixReport/JunitReporterTest.php',
-];
-$ignoreErrors[] = [
-	'message' => '#^Static property PhpCsFixer\\\\Tests\\\\Console\\\\Report\\\\FixReport\\\\XmlReporterTest\\:\\:\\$xsd \\(string\\|null\\) does not accept string\\|false\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/../../tests/Console/Report/FixReport/XmlReporterTest.php',
-];
 $ignoreErrors[] = [
 	'message' => '#^Method PhpCsFixer\\\\Tests\\\\Fixer\\\\Basic\\\\EncodingFixerTest\\:\\:prepareTestCase\\(\\) should return array\\{string, string\\|null, SplFileInfo\\} but returns array\\{string\\|false, string\\|false\\|null, SplFileInfo\\}\\.$#',
 	'count' => 1,

+ 10 - 1
tests/Console/Report/FixReport/CheckstyleReporterTest.php

@@ -38,11 +38,20 @@ final class CheckstyleReporterTest extends AbstractReporterTestCase
 
     public static function setUpBeforeClass(): void
     {
-        self::$xsd = file_get_contents(__DIR__.'/../../../../doc/schemas/fix/checkstyle.xsd');
+        parent::setUpBeforeClass();
+
+        $content = file_get_contents(__DIR__.'/../../../../doc/schemas/fix/checkstyle.xsd');
+        if (false === $content) {
+            throw new \RuntimeException('Cannot read file.');
+        }
+
+        self::$xsd = $content;
     }
 
     public static function tearDownAfterClass(): void
     {
+        parent::tearDownAfterClass();
+
         self::$xsd = null;
     }
 

+ 6 - 1
tests/Console/Report/FixReport/JunitReporterTest.php

@@ -43,7 +43,12 @@ final class JunitReporterTest extends AbstractReporterTestCase
     {
         parent::setUpBeforeClass();
 
-        self::$xsd = file_get_contents(__DIR__.'/../../../../doc/schemas/fix/junit-10.xsd');
+        $content = file_get_contents(__DIR__.'/../../../../doc/schemas/fix/junit-10.xsd');
+        if (false === $content) {
+            throw new \RuntimeException('Cannot read file.');
+        }
+
+        self::$xsd = $content;
     }
 
     public static function tearDownAfterClass(): void

+ 6 - 1
tests/Console/Report/FixReport/XmlReporterTest.php

@@ -39,7 +39,12 @@ final class XmlReporterTest extends AbstractReporterTestCase
     {
         parent::setUpBeforeClass();
 
-        self::$xsd = file_get_contents(__DIR__.'/../../../../doc/schemas/fix/xml.xsd');
+        $content = file_get_contents(__DIR__.'/../../../../doc/schemas/fix/xml.xsd');
+        if (false === $content) {
+            throw new \RuntimeException('Cannot read file.');
+        }
+
+        self::$xsd = $content;
     }
 
     public static function tearDownAfterClass(): void

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