From 6c71d68b215c03ffba0ecc4fd745bb7613d5ebc7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Barto=C5=A1?=
- - + + diff --git a/composer.json b/composer.json index f9df447..ae1d9bb 100644 --- a/composer.json +++ b/composer.json @@ -35,6 +35,7 @@ "phpstan/extension-installer": "^1.0.0", "phpstan/phpstan": "^1.0.0", "phpstan/phpstan-deprecation-rules": "^1.0.0", + "phpstan/phpstan-nette": "^1.2.0", "phpstan/phpstan-phpunit": "^1.0.0", "phpstan/phpstan-strict-rules": "^1.0.0", "phpunit/phpunit": "^9.5.0", diff --git a/tools/phpstan.baseline.neon b/tools/phpstan.baseline.neon new file mode 100644 index 0000000..1af1f06 --- /dev/null +++ b/tools/phpstan.baseline.neon @@ -0,0 +1,26 @@ +parameters: + ignoreErrors: + - + message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) with 'OriNette\\\\\\\\Http\\\\\\\\Auth\\\\\\\\HttpAuthenticator' and OriNette\\\\Http\\\\Auth\\\\HttpAuthenticator will always evaluate to true\\.$#" + count: 3 + path: ../tests/Unit/Auth/DI/HttpAuthExtensionTest.php + + - + message: "#^Call to function method_exists\\(\\) with 'Nette\\\\\\\\Http\\\\\\\\Request' and 'getBasicCredentials' will always evaluate to true\\.$#" + count: 2 + path: ../tests/Unit/Auth/HttpAuthenticatorTest.php + + - + message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertTrue\\(\\) with true will always evaluate to true\\.$#" + count: 4 + path: ../tests/Unit/Auth/HttpAuthenticatorTest.php + + - + message: "#^Parameter \\#2 \\$string of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertStringStartsWith\\(\\) expects string, string\\|null given\\.$#" + count: 1 + path: ../tests/Unit/Tester/TestResponseTest.php + + - + message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) with 'OriNette\\\\\\\\Http\\\\\\\\Tracy\\\\\\\\HttpPanel' and null will always evaluate to false\\.$#" + count: 1 + path: ../tests/Unit/Tracy/DI/HttpPanelExtensionTest.php diff --git a/tools/phpstan.base.neon b/tools/phpstan.neon similarity index 65% rename from tools/phpstan.base.neon rename to tools/phpstan.neon index fde599d..ac19c8d 100644 --- a/tools/phpstan.base.neon +++ b/tools/phpstan.neon @@ -1,9 +1,12 @@ includes: - ../vendor/phpstan/phpstan/conf/bleedingEdge.neon + - phpstan.baseline.neon parameters: - phpVersion: 70400 + phpVersion: 80000 + level: 8 tmpDir: ../var/tools/PHPStan + resultCachePath: %currentWorkingDirectory%/var/tools/PHPStan/resultCache.php checkBenevolentUnionTypes: true checkMissingCallableSignature: true @@ -16,3 +19,6 @@ parameters: tooWideThrowType: true checkedExceptionClasses: - Orisai\Exceptions\Check\CheckedException + + ignoreErrors: + - '#^Fetching deprecated class constant (S302_FOUND|S401_UNAUTHORIZED)(.+)#' diff --git a/tools/phpstan.src.neon b/tools/phpstan.src.neon deleted file mode 100644 index 2b042d9..0000000 --- a/tools/phpstan.src.neon +++ /dev/null @@ -1,9 +0,0 @@ -includes: - - phpstan.base.neon - -parameters: - level: 8 - resultCachePath: %currentWorkingDirectory%/var/tools/PHPStan/resultCache.src.php - - ignoreErrors: - - '#^Fetching deprecated class constant (S302_FOUND|S401_UNAUTHORIZED)(.+)#' diff --git a/tools/phpstan.tests.neon b/tools/phpstan.tests.neon deleted file mode 100644 index e8088f8..0000000 --- a/tools/phpstan.tests.neon +++ /dev/null @@ -1,9 +0,0 @@ -includes: - - phpstan.base.neon - -parameters: - level: 3 - resultCachePath: %currentWorkingDirectory%/var/tools/PHPStan/resultCache.tests.php - - scanDirectories: - - ../src