Completed
Push — develop ( df9395...08456a )
by Abdelrahman
16:28
created

SeederMakeCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 24
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getPath() 0 10 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cortex\Foundation\Console\Commands;
6
7
use Cortex\Foundation\Traits\ConsoleMakeModuleCommand;
8
use Illuminate\Database\Console\Seeds\SeederMakeCommand as BaseSeederMakeCommand;
9
10
class SeederMakeCommand extends BaseSeederMakeCommand
11
{
12
    use ConsoleMakeModuleCommand;
13
14
    /**
15
     * Get the destination class path.
16
     *
17
     * @param  string $name
18
     *
19
     * @throws \Exception
20
     *
21
     * @return string
22
     */
23
    protected function getPath($name)
24
    {
25
        $name = $this->moduleName().DIRECTORY_SEPARATOR.'database'.DIRECTORY_SEPARATOR.'seeds'.DIRECTORY_SEPARATOR.$name;
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 121 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
26
27
        if (! $this->files->exists($path = $this->laravel['path'].DIRECTORY_SEPARATOR.$this->moduleName().DIRECTORY_SEPARATOR)) {
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 129 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
28
            throw new \Exception("Invalid path: {$path}");
29
        }
30
31
        return $this->laravel['path'].DIRECTORY_SEPARATOR.str_replace('\\', DIRECTORY_SEPARATOR, $name).'.php';
32
    }
33
}
34