Skip to content

Commit 919abe3

Browse files
committed
Update RegexArrayShapeMatcher.php
1 parent d05a40f commit 919abe3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Type/Php/RegexArrayShapeMatcher.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,13 @@ private function getPatternType(Expr $patternExpr, Scope $scope): Type
509509
return $scope->getType($patternExpr);
510510
}
511511

512+
/**
513+
* Ignores preg_quote() calls in the concatenation as these are not relevant for array-shape matching.
514+
*
515+
* This assumption only works for the ArrayShapeMatcher therefore it is not implemented for the common case in Scope.
516+
*
517+
* see https://github.com/phpstan/phpstan-src/pull/3233#discussion_r1676938085
518+
*/
512519
private function resolvePatternConcat(Expr\BinaryOp\Concat $concat, Scope $scope): Type
513520
{
514521
if (

0 commit comments

Comments
 (0)