Skip to content

Commit

Permalink
add phpstan error identifiers (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
pilif authored Jun 13, 2024
1 parent c75a883 commit 21592f0
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"keywords": ["static analysis", "phpstan-extension"],
"require": {
"php": "^8.2",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan": "^1.11",
"webmozart/assert": "^1.11",
"nikic/php-parser": "^4.19"
},
Expand Down
1 change: 1 addition & 0 deletions src/Rules/LocalOnlyPublicClassMethodRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public function processNode(Node $node, Scope $scope): array
->file($filePath)
->line($line)
->tip(RuleTips::NARROW_SCOPE)
->identifier('public.method.unused')
->build();
}
}
Expand Down
1 change: 1 addition & 0 deletions src/Rules/RelativeUnusedPublicClassMethodRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ private function createRuleErrors(array $filePathToLines, float $relative, int|f
$ruleErrors[] = RuleErrorBuilder::message($errorMessage)
->file($filePath)
->line($line)
->identifier('public.method.unused')
->build();
}
}
Expand Down
1 change: 1 addition & 0 deletions src/Rules/UnusedPublicClassConstRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public function processNode(Node $node, Scope $scope): array
->file($filePath)
->line($line)
->tip(RuleTips::SOLUTION_MESSAGE)
->identifier('public.classConstant.unused')
->build();
}
}
Expand Down
1 change: 1 addition & 0 deletions src/Rules/UnusedPublicClassMethodRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public function processNode(Node $node, Scope $scope): array
->file($filePath)
->line($line)
->tip(RuleTips::SOLUTION_MESSAGE)
->identifier('public.method.unused')
->build();
}
}
Expand Down
1 change: 1 addition & 0 deletions src/Rules/UnusedPublicPropertyRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public function processNode(Node $node, Scope $scope): array
->file($filePath)
->line($line)
->tip(RuleTips::SOLUTION_MESSAGE)
->identifier('public.property.unused')
->build();
}
}
Expand Down

0 comments on commit 21592f0

Please sign in to comment.