Passed
Push — master ( 3cb518...ba9ea6 )
by Thomas
40s
created

SeederService::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Webfactor\Laravel\Generators\Services;
4
5
use Webfactor\Laravel\Generators\Contracts\ServiceAbstract;
6
use Webfactor\Laravel\Generators\Contracts\ServiceInterface;
7
8
class SeederService extends ServiceAbstract implements ServiceInterface
9
{
10
    protected $relativeToBasePath = 'database/seeds';
11
12
    public function call()
13
    {
14
        $this->command->call('make:seeder', [
15
            'name' => $this->getName($this->command->entity),
16
        ]);
17
18
        $this->addLatestFileToIdeStack();
19
    }
20
21
    public function getName(string $entity): string
22
    {
23
        return ucfirst(str_plural($entity)) . 'TableSeeder';
24
    }
25
}
26