File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ public function transform(
7676 ) {
7777 $ line = $ ruleError ->getLine ();
7878 } else {
79- $ line = $ this -> getLineFromNode ($ node );
79+ $ line = self :: getLineFromNode ($ node );
8080 }
8181 if (
8282 $ ruleError instanceof FileRuleError
@@ -168,10 +168,10 @@ public function transform(
168168 );
169169 }
170170
171- private function getLineFromNode (Node $ node ): int
171+ public static function getLineFromNode (Node $ node ): int
172172 {
173173 if ($ node instanceof PropertyAssignNode) {
174- return $ this -> getLineFromNode ($ node ->getPropertyFetch ());
174+ return self :: getLineFromNode ($ node ->getPropertyFetch ());
175175 }
176176
177177 if (
Original file line number Diff line number Diff line change 55use PhpParser \Node ;
66use PhpParser \Node \Expr ;
77use PHPStan \Analyser \MutatingScope ;
8+ use PHPStan \Analyser \RuleErrorTransformer ;
89use PHPStan \Analyser \Scope ;
910use PHPStan \DependencyInjection \AutowiredParameter ;
1011use PHPStan \DependencyInjection \AutowiredService ;
@@ -89,11 +90,7 @@ public function check(
8990 string $ namedArgumentMessage ,
9091 ): array
9192 {
92- if ($ funcCall instanceof Node \Expr \MethodCall || $ funcCall instanceof Node \Expr \StaticCall || $ funcCall instanceof Node \Expr \FuncCall) {
93- $ funcCallLine = $ funcCall ->name ->getStartLine ();
94- } else {
95- $ funcCallLine = $ funcCall ->getStartLine ();
96- }
93+ $ funcCallLine = RuleErrorTransformer ::getLineFromNode ($ funcCall );
9794
9895 $ functionParametersMinCount = 0 ;
9996 $ functionParametersMaxCount = 0 ;
You can’t perform that action at this time.
0 commit comments