mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 18:13:11 +00:00
Add tests for PHP class attribute placement and fix whitespace in regex
Co-authored-by: barryvdh <[email protected]>
This commit is contained in:
co-authored by
barryvdh
parent
7cd11e292c
commit
ee7b0cf6bd
@@ -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";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user