From a09a8f2efec7625db7b085065345f6a64f772c53 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 16 Jul 2024 16:56:01 +0200 Subject: [PATCH] Update RegexArrayShapeMatcher.php --- src/Type/Php/RegexArrayShapeMatcher.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Type/Php/RegexArrayShapeMatcher.php b/src/Type/Php/RegexArrayShapeMatcher.php index e0b3f37fb7..dd000361db 100644 --- a/src/Type/Php/RegexArrayShapeMatcher.php +++ b/src/Type/Php/RegexArrayShapeMatcher.php @@ -556,14 +556,15 @@ private function createGroupType(TreeNode $group): Type if ($accessories !== []) { return new IntersectionType([ new StringType(), - ...$accessories + ...$accessories, ]); } return new StringType(); } - private function walkGroupAst(TreeNode $ast, TrinaryLogic &$isNonEmpty, TrinaryLogic &$isNumeric, bool &$inOptionalQuantification): void { + private function walkGroupAst(TreeNode $ast, TrinaryLogic &$isNonEmpty, TrinaryLogic &$isNumeric, bool &$inOptionalQuantification): void + { $children = $ast->getChildren(); if ( @@ -592,7 +593,7 @@ private function walkGroupAst(TreeNode $ast, TrinaryLogic &$isNonEmpty, TrinaryL } if ($ast->getValueToken() === 'character_type') { - if ('\d' === $ast->getValueValue()) { + if ($ast->getValueValue() === '\d') { if ($isNumeric->maybe()) { $isNumeric = TrinaryLogic::createYes(); } @@ -609,7 +610,7 @@ private function walkGroupAst(TreeNode $ast, TrinaryLogic &$isNonEmpty, TrinaryL if ($ast->getId() === '#range') { if ($isNumeric->maybe()) { $allNumeric = true; - foreach($children as $child) { + foreach ($children as $child) { $literalValue = $this->getLiteralValue($child); if ($literalValue === null) { @@ -632,12 +633,12 @@ private function walkGroupAst(TreeNode $ast, TrinaryLogic &$isNonEmpty, TrinaryL } } - foreach($children as $child) { + foreach ($children as $child) { $this->walkGroupAst( $child, $isNonEmpty, $isNumeric, - $inOptionalQuantification + $inOptionalQuantification, ); } }