Skip to content

Commit 321f8fa

Browse files
staabmclxmstaab
andauthored
remove depedency on symplify/astral (#72)
Co-authored-by: Markus Staab <[email protected]>
1 parent 537507c commit 321f8fa

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

src/PdoReflection/PdoStatementReflection.php

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,24 @@
1313
use PhpParser\NodeFinder;
1414
use PHPStan\Reflection\MethodReflection;
1515
use PHPStan\ShouldNotHappenException;
16-
use Symplify\Astral\ValueObject\AttributeKey;
1716

1817
final 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

Comments
 (0)