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

ControllerMakeCommand::getStub()   A

Complexity

Conditions 4
Paths 4

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 12
rs 9.8666
cc 4
nc 4
nop 0
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