99use PhpParser \Node \Expr \MethodCall ;
1010use PHPStan \Analyser \Scope ;
1111use PHPStan \Reflection \MethodReflection ;
12+ use PHPStan \Rules \IdentifierRuleError ;
1213use PHPStan \Rules \Rule ;
1314use PHPStan \Rules \RuleError ;
1415use PHPStan \Rules \RuleErrorBuilder ;
@@ -55,7 +56,7 @@ public function processNode(Node $methodCall, Scope $scope): array
5556 }
5657
5758 /**
58- * @return RuleError[]
59+ * @return list<IdentifierRuleError>
5960 */
6061 private function checkErrors (MethodReflection $ methodReflection , MethodCall $ methodCall , Scope $ scope ): array
6162 {
@@ -97,7 +98,7 @@ private function checkErrors(MethodReflection $methodReflection, MethodCall $met
9798 $ parameters = $ queryReflection ->resolveParameters ($ parameterTypes ) ?? [];
9899 } catch (UnresolvableQueryException $ exception ) {
99100 return [
100- RuleErrorBuilder::message ($ exception ->asRuleMessage ())->tip ($ exception ::getTip ())->line ($ methodCall ->getStartLine ())->build (),
101+ RuleErrorBuilder::message ($ exception ->asRuleMessage ())->tip ($ exception ::getTip ())->identifier ( ' dba.unresolvableQuery ' )-> line ($ methodCall ->getStartLine ())->build (),
101102 ];
102103 }
103104
@@ -110,13 +111,13 @@ private function checkErrors(MethodReflection $methodReflection, MethodCall $met
110111 }
111112 } catch (UnresolvableQueryException $ exception ) {
112113 return [
113- RuleErrorBuilder::message ($ exception ->asRuleMessage ())->tip ($ exception ::getTip ())->line ($ methodCall ->getStartLine ())->build (),
114+ RuleErrorBuilder::message ($ exception ->asRuleMessage ())->tip ($ exception ::getTip ())->identifier ( ' dba.unresolvableQuery ' )-> line ($ methodCall ->getStartLine ())->build (),
114115 ];
115116 }
116117
117118 $ ruleErrors = [];
118119 foreach ($ errors as $ error ) {
119- $ ruleErrors [] = RuleErrorBuilder::message ($ error )->line ($ methodCall ->getStartLine ())->build ();
120+ $ ruleErrors [] = RuleErrorBuilder::message ($ error )->identifier ( ' dba.invalidPlaceholder ' )-> line ($ methodCall ->getStartLine ())->build ();
120121 }
121122
122123 return $ ruleErrors ;
0 commit comments