Skip to content

Commit

Permalink
Naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Rumpel committed Oct 21, 2020
1 parent 909bbd5 commit 4705972
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/LaravelFactoryExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,18 +263,18 @@ private function formatMultipleLinesFactoryMethod(Stringable $newMethodBody): st

return collect(explode(PHP_EOL, $newMethodBody))
->map(function ($line) use (&$lineBefore) {
$prepend = ' ';
$prependSpaces = ' ';
// Add indention if the line before opens a function
if (Str::of($lineBefore)
->endsWith('{')) {
$prepend .= ' ';
$prependSpaces .= ' ';
}

$lineBefore = $line;

return Str::of($line)
->ltrim(' ')
->prepend($prepend);
->prepend($prependSpaces);
})
->map(function ($line, $key) use (&$lineBefore) {
if ($key === 0) {
Expand Down

0 comments on commit 4705972

Please sign in to comment.