Completed
Push — master ( e6ed9d...330f1c )
by Brent
17s queued 11s
created

ActionMakeCommand::getStub()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
namespace Spatie\QueueableAction;
4
5
use Illuminate\Console\GeneratorCommand;
6
use Symfony\Component\Console\Input\InputOption;
7
8
class ActionMakeCommand extends GeneratorCommand
9
{
10
    protected $name = 'make:action';
11
12
    protected $description = 'Create a new action class';
13
14
    protected $type = 'Action';
15
16
    protected function getStub(): string
17
    {
18
        return $this->option('sync')
19
            ? __DIR__.'/stubs/action.stub'
20
            : __DIR__.'/stubs/action-queued.stub';
21
    }
22
23
    protected function getDefaultNamespace($rootNamespace): string
24
    {
25
        return $rootNamespace.'\Actions';
26
    }
27
28
    protected function getOptions(): array
29
    {
30
        return [
31
            ['sync', null, InputOption::VALUE_NONE, 'Indicates that action should be synchronous'],
32
        ];
33
    }
34
}
35