Completed
Push — master ( 0e1003...1276c7 )
by Abdelrahman
61:46 queued 59:06
created

ControllerMakeCommand   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 3
dl 0
loc 23
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getStub() 0 12 4
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cortex\Foundation\Console\Commands;
6
7
use Illuminate\Console\ConfirmableTrait;
8
use Cortex\Foundation\Traits\ConsoleMakeModuleCommand;
9
use Illuminate\Routing\Console\ControllerMakeCommand as BaseControllerMakeCommand;
10
11
class ControllerMakeCommand extends BaseControllerMakeCommand
12
{
13
    use ConfirmableTrait;
14
    use ConsoleMakeModuleCommand;
15
16
    /**
17
     * Get the stub file for the generator.
18
     *
19
     * @return string
20
     */
21
    protected function getStub(): string
22
    {
23
        if ($this->option('parent')) {
24
            return __DIR__.'/../../../resources/stubs/controller.nested.stub';
25
        } elseif ($this->option('model')) {
26
            return __DIR__.'/../../../resources/stubs/controller.model.stub';
27
        } elseif ($this->option('resource')) {
28
            return __DIR__.'/../../../resources/stubs/controller.stub';
29
        }
30
31
        return __DIR__.'/../../../resources/stubs/controller.plain.stub';
32
    }
33
}
34