Skip to content

Commit 74894df

Browse files
committed
Naming things is hard
1 parent 15cb63f commit 74894df

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Generators/SeederGenerator.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function output(Tree $tree): array
3131

3232
$output = [];
3333

34-
if ($this->isLaravel8Up()) {
34+
if ($this->isLaravel8OrHigher()) {
3535
$stub = $this->files->stub('seeder.stub');
3636
} else {
3737
$stub = $this->files->stub('seeder.no-factory.stub');
@@ -55,7 +55,7 @@ public function types(): array
5555
protected function populateStub(string $stub, string $model)
5656
{
5757
$stub = str_replace('{{ class }}', $this->getClassName($model), $stub);
58-
if ($this->isLaravel8Up()) {
58+
if ($this->isLaravel8OrHigher()) {
5959
$this->addImport($model, 'Illuminate\Database\Seeder');
6060

6161
$stub = str_replace('//', $this->build($model), $stub);
@@ -73,7 +73,7 @@ protected function getClassName(string $model)
7373

7474
protected function build(string $model)
7575
{
76-
if ($this->isLaravel8Up()) {
76+
if ($this->isLaravel8OrHigher()) {
7777
$this->addImport($model, $this->tree->fqcnForContext($model));
7878
return sprintf('%s::factory()->times(5)->create();', class_basename($this->tree->fqcnForContext($model)));
7979
}
@@ -100,7 +100,7 @@ private function getPath($model)
100100
return 'database/seeds/'.$model.'Seeder.php';
101101
}
102102

103-
protected function isLaravel8Up()
103+
protected function isLaravel8OrHigher()
104104
{
105105
return version_compare(App::version(), '8.0.0', '>=');
106106
}

0 commit comments

Comments
 (0)