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

ControllerMakeCommand::getStub()   A

Complexity

Conditions 4
Paths 4

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 12
rs 9.2
c 1
b 0
f 0
cc 4
eloc 8
nc 4
nop 0
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\Routing\Console\ControllerMakeCommand as BaseControllerMakeCommand;
9
10
class ControllerMakeCommand extends BaseControllerMakeCommand
11
{
12
    use ConsoleMakeModuleCommand;
13
14
    /**
15
     * Get the stub file for the generator.
16
     *
17
     * @return string
18
     */
19
    protected function getStub()
20
    {
21
        if ($this->option('parent')) {
22
            return __DIR__.'/../../../resources/stubs/controller.nested.stub';
23
        } elseif ($this->option('model')) {
24
            return __DIR__.'/../../../resources/stubs/controller.model.stub';
25
        } elseif ($this->option('resource')) {
26
            return __DIR__.'/../../../resources/stubs/controller.stub';
27
        }
28
29
        return __DIR__.'/../../../resources/stubs/controller.plain.stub';
30
    }
31
}
32