Skip to content

Commit f0de699

Browse files
committed
[FIX] Make 'non greedy' search to target first matched keys. It was an issue if multi-level array had keys with same name in its children.
1 parent b6de1ae commit f0de699

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/DataWriter/Rewrite.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ protected function buildArrayOpeningExpression(array $arrayItems): string
212212
}
213213

214214
// Capture all opening array (non greedy)
215-
$result = '(' . implode('[\s\S]*', $itemOpen) . '[\s\S]*?)';
215+
$result = '(' . implode('[\s\S]*?', $itemOpen) . '[\s\S]*?)';
216216
}
217217
else {
218218
// Gotta capture something for $1

0 commit comments

Comments
 (0)