Add tests for PHP class attribute placement and fix whitespace in regex

Co-authored-by: barryvdh <[email protected]>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-04 10:22:21 +00:00
co-authored by barryvdh
parent 7cd11e292c
commit ee7b0cf6bd
5 changed files with 58 additions and 1 deletions
+1 -1
View File
@@ -1206,7 +1206,7 @@ class ModelsCommand extends Command
// declaration, insert the docblock before the first attribute so that
// the resulting order is: docblock → attributes → class.
$before = substr($contents, 0, $pos);
if (preg_match('/(\s*(?:#\[.+?\]\s*)+)$/s', $before, $matches)) {
if (preg_match('/((?:#\[.+?\]\s*)+)$/s', $before, $matches)) {
$pos -= strlen($matches[1]);
$replace = "{$modelDocComment}\n";
}