Skip to content

Commit

Permalink
PHPStan cleanup (#998)
Browse files Browse the repository at this point in the history
  • Loading branch information
kubawerlos authored Dec 30, 2024
1 parent 9700f5a commit 7c4ba8c
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 52 deletions.
14 changes: 0 additions & 14 deletions .dev-tools/phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
38 changes: 0 additions & 38 deletions .dev-tools/sca.stub

This file was deleted.

1 change: 1 addition & 0 deletions src/Fixer/NoDuplicatedImportsFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ private function removeUseDeclaration(Tokens $tokens, NamespaceUseAnalysis $useD
Tokens $tokens,
NamespaceUseAnalysis $useDeclaration
): void {
// @phpstan-ignore method.private
$noUnusedImportsFixer->removeUseDeclaration($tokens, $useDeclaration);
};

Expand Down
1 change: 1 addition & 0 deletions src/Fixer/PromotedConstructorPropertyFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}

Expand Down
1 change: 1 addition & 0 deletions src/Fixer/StringableInterfaceFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}

Expand Down

0 comments on commit 7c4ba8c

Please sign in to comment.