Skip to content

Commit 21ef6ff

Browse files
DenTrayCopilot
andauthored
Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 569c284 commit 21ef6ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Generators/ModelGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ protected function insertPropertyAnnotation(string &$content, string $propertyDa
268268

269269
// TODO: use ronasit/larabuilder instead regexp
270270
if (!Str::contains($content, '/**')) {
271-
$content = preg_replace('/^\s*class.*\n/m', "\n/**\n {$annotation}\n */$0", $content);
271+
$content = preg_replace('/^\s*class[\s\S]+?\{/m', "\n/**\n {$annotation}\n */$0", $content);
272272
} else {
273273
$content = preg_replace('/\*\/\n/', "{$annotation}\n $0", $content);
274274
}

0 commit comments

Comments
 (0)