Skip to content

Commit 5674e99

Browse files
committed
Node\Scalar\EncapsedStringPart is now Node\InterpolatedStringPart and no longer extends Node\Scalar or Node\Expr.
1 parent 5c0adca commit 5674e99

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/QueryReflection/QueryReflection.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Composer\InstalledVersions;
88
use PhpParser\Node\Expr;
99
use PhpParser\Node\Expr\BinaryOp\Concat;
10+
use PhpParser\Node\InterpolatedStringPart;
1011
use PhpParser\Node\Scalar\Encapsed;
1112
use PhpParser\Node\Scalar\EncapsedStringPart;
1213
use PHPStan\Analyser\Scope;
@@ -372,6 +373,11 @@ private function resolveQueryStringExpr(Expr $queryExpr, Scope $scope, bool $res
372373
if ($queryExpr instanceof Encapsed) {
373374
$string = '';
374375
foreach ($queryExpr->parts as $part) {
376+
if ($part instanceof InterpolatedStringPart) {
377+
$string .= $part->value;
378+
continue;
379+
}
380+
375381
$resolvedPart = $this->resolveQueryStringExpr($part, $scope);
376382
if (null === $resolvedPart) {
377383
return null;
@@ -382,10 +388,6 @@ private function resolveQueryStringExpr(Expr $queryExpr, Scope $scope, bool $res
382388
return $string;
383389
}
384390

385-
if ($queryExpr instanceof EncapsedStringPart) {
386-
return $queryExpr->value;
387-
}
388-
389391
$type = $scope->getType($queryExpr);
390392

391393
return QuerySimulation::simulateParamValueType($type, false);

0 commit comments

Comments
 (0)