Skip to content

Commit 0da25fe

Browse files
committed
fix error target to method
1 parent 87390a0 commit 0da25fe

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/Rules/Symfony/NoControllerMethodInjectionRule.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public function processNode(Node $node, Scope $scope): array
7474

7575
$identifierRuleError = RuleErrorBuilder::message(sprintf(self::ERROR_MESSAGE, $typeName))
7676
->identifier(SymfonyRuleIdentifier::NO_CONTROLLER_METHOD_INJECTION)
77+
->line($classMethod->getStartLine())
7778
->build();
7879

7980
$ruleErrors[] = $identifierRuleError;

tests/Rules/Symfony/NoControllerMethodInjectionRule/NoControllerMethodInjectionRuleTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public static function provideData(): Iterator
2626
{
2727
yield [__DIR__ . '/Fixture/SomeActionInjectionController.php', [[
2828
sprintf(NoControllerMethodInjectionRule::ERROR_MESSAGE, SomeService::class),
29-
10,
29+
15,
3030
]]];
3131

3232
yield [__DIR__ . '/Fixture/SkipRequestParameterController.php', []];

0 commit comments

Comments
 (0)