Skip to content

Commit c56deae

Browse files
authored
Merge pull request #161 from artengin/master
Fixed formatting issues in seeder generation and registration. Closes…
2 parents 64abc1f + 455f7fd commit c56deae

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

src/Generators/SeederGenerator.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function generate(): void
4545

4646
protected function createDatabaseSeeder(): void
4747
{
48-
$content = "<?php \n\n" . $this->getStub('database_empty_seeder', [
48+
$content = "<?php\n\n" . $this->getStub('database_empty_seeder', [
4949
'namespace' => $this->getOrCreateNamespace('seeders')
5050
]);
5151

@@ -58,12 +58,12 @@ protected function createDatabaseSeeder(): void
5858

5959
protected function createEntitySeeder(): void
6060
{
61-
$content = "<?php \n\n" . $this->getStub('seeder', [
61+
$content = "<?php\n\n" . $this->getStub('seeder', [
6262
'entity' => $this->model,
6363
'relations' => $this->relations->toArray(),
6464
'namespace' => $this->getOrCreateNamespace('seeders'),
6565
'factoryNamespace' => $this->getOrCreateNamespace('factories'),
66-
]);
66+
]) . "\n";
6767

6868
$seederPath = "{$this->seedsPath}/{$this->model}Seeder.php";
6969

@@ -78,10 +78,10 @@ protected function appendSeederToList(): void
7878
{
7979
$content = file_get_contents($this->databaseSeederPath);
8080

81-
$insertContent = " \$this->call({$this->model}Seeder::class);\n }\n}";
81+
$insertContent = " \$this->call({$this->model}Seeder::class);\n }\n}\n";
8282

8383
$fixedContent = preg_replace('/\}\s*\}\s*\z/', $insertContent, $content);
8484

8585
file_put_contents($this->databaseSeederPath, $fixedContent);
8686
}
87-
}
87+
}

tests/fixtures/CommandTest/seeder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php
22

33
namespace Database\Seeders;
44

@@ -12,4 +12,4 @@ public function run()
1212
PostFactory::new()->create();
1313

1414
}
15-
}
15+
}

tests/fixtures/SeederGeneratorTest/database_seeder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php
22

33
namespace Database\Seeders;
44

@@ -15,4 +15,4 @@ public function run()
1515
{
1616
$this->call(PostSeeder::class);
1717
}
18-
}
18+
}

tests/fixtures/SeederGeneratorTest/post_seeder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php
22

33
namespace Database\Seeders;
44

@@ -18,4 +18,4 @@ public function run()
1818
]);
1919

2020
}
21-
}
21+
}

0 commit comments

Comments
 (0)