diff --git a/.dev-tools/phpstan.neon b/.dev-tools/phpstan.neon index 373a13ed..7123def2 100644 --- a/.dev-tools/phpstan.neon +++ b/.dev-tools/phpstan.neon @@ -5,26 +5,12 @@ includes: parameters: bootstrapFiles: - ../vendor/autoload.php - ignoreErrors: - - - message: '#^Comparison operation "\>\=" between int\<80400, 80499\> and 80000 is always true\.$#' - identifier: greaterOrEqual.alwaysTrue - count: 1 - path: ../src/Fixer/PromotedConstructorPropertyFixer.php - - - - message: '#^Comparison operation "\>\=" between int\<80400, 80499\> and 80000 is always true\.$#' - identifier: greaterOrEqual.alwaysTrue - count: 1 - path: ../src/Fixer/StringableInterfaceFixer.php level: max paths: - ../src - ../tests - ../bootstrap.php reportMaybesInMethodSignatures: false - stubFiles: - - ./sca.stub treatPhpDocTypesAsCertain: false type_coverage: declare: 100 diff --git a/.dev-tools/sca.stub b/.dev-tools/sca.stub deleted file mode 100644 index ea1c4b71..00000000 --- a/.dev-tools/sca.stub +++ /dev/null @@ -1,38 +0,0 @@ - - * - * @method Token offsetGet() - * @method array toArray() - */ - class Tokens extends \SplFixedArray {} - - /** - * @method array getClassyElements() - */ - final class TokensAnalyzer {} -} - -namespace PhpCsFixer\Tokenizer\Analyzer\Analysis { - final class NamespaceUseAnalysis {} -} diff --git a/src/Fixer/NoDuplicatedImportsFixer.php b/src/Fixer/NoDuplicatedImportsFixer.php index ed23b6ca..53a6ab0f 100644 --- a/src/Fixer/NoDuplicatedImportsFixer.php +++ b/src/Fixer/NoDuplicatedImportsFixer.php @@ -80,6 +80,7 @@ private function removeUseDeclaration(Tokens $tokens, NamespaceUseAnalysis $useD Tokens $tokens, NamespaceUseAnalysis $useDeclaration ): void { + // @phpstan-ignore method.private $noUnusedImportsFixer->removeUseDeclaration($tokens, $useDeclaration); }; diff --git a/src/Fixer/PromotedConstructorPropertyFixer.php b/src/Fixer/PromotedConstructorPropertyFixer.php index ff4c1475..1b3ef9f7 100644 --- a/src/Fixer/PromotedConstructorPropertyFixer.php +++ b/src/Fixer/PromotedConstructorPropertyFixer.php @@ -93,6 +93,7 @@ public function getPriority(): int public function isCandidate(Tokens $tokens): bool { + // @phpstan-ignore greaterOrEqual.alwaysTrue return \PHP_VERSION_ID >= 80000 && $tokens->isAllTokenKindsFound([\T_CLASS, \T_VARIABLE]); } diff --git a/src/Fixer/StringableInterfaceFixer.php b/src/Fixer/StringableInterfaceFixer.php index bf95af4c..3367610e 100644 --- a/src/Fixer/StringableInterfaceFixer.php +++ b/src/Fixer/StringableInterfaceFixer.php @@ -46,6 +46,7 @@ public function getPriority(): int public function isCandidate(Tokens $tokens): bool { + // @phpstan-ignore greaterOrEqual.alwaysTrue return \PHP_VERSION_ID >= 80000 && $tokens->isAllTokenKindsFound([\T_CLASS, \T_STRING]); }