1313use PhpParser \NodeFinder ;
1414use PHPStan \Reflection \MethodReflection ;
1515use PHPStan \ShouldNotHappenException ;
16- use Symplify \Astral \ValueObject \AttributeKey ;
1716
1817final class PdoStatementReflection
1918{
19+ /**
20+ * Do not change, part of internal PHPStan naming
21+ *
22+ * @var string
23+ */
24+ private const PREVIOUS = 'previous ' ;
25+
26+ /**
27+ * Convention key name in php-parser and PHPStan for parent node
28+ *
29+ * @var string
30+ */
31+ private const PARENT = 'parent ' ;
32+
33+
2034 private NodeFinder $ nodeFinder ;
2135
2236 public function __construct ()
@@ -77,7 +91,7 @@ private function findQueryStringExpression(MethodCall $methodCall): ?Expr
7791 private function findFirstPreviousOfNode (Node $ node , callable $ filter ): ?Node
7892 {
7993 // move to previous expression
80- $ previousStatement = $ node ->getAttribute (AttributeKey ::PREVIOUS );
94+ $ previousStatement = $ node ->getAttribute (self ::PREVIOUS );
8195 if (null !== $ previousStatement ) {
8296 if (!$ previousStatement instanceof Node) {
8397 throw new ShouldNotHappenException ();
@@ -91,7 +105,7 @@ private function findFirstPreviousOfNode(Node $node, callable $filter): ?Node
91105 return $ this ->findFirstPreviousOfNode ($ previousStatement , $ filter );
92106 }
93107
94- $ parent = $ node ->getAttribute (AttributeKey ::PARENT );
108+ $ parent = $ node ->getAttribute (self ::PARENT );
95109 if ($ parent instanceof FunctionLike) {
96110 return null ;
97111 }
0 commit comments