Passed
Push — master ( 40ce26...965fb6 )
by Arthur
22:04
created

PermissionMakeCommand::stubOptions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Foundation\Generator\Commands;
4
5
use Foundation\Generator\Abstracts\ClassGeneratorCommand;
6
use Foundation\Generator\Events\ExceptionGeneratedEvent;
7
use Foundation\Generator\Events\PermissionGeneratedEvent;
8
use Illuminate\Support\Str;
9
10
class PermissionMakeCommand extends ClassGeneratorCommand
11
{
12
    /**
13
     * The console command name.
14
     *
15
     * @var string
16
     */
17
    protected $name = 'larapi:make:permission';
18
19
    /**
20
     * The console command description.
21
     *
22
     * @var string
23
     */
24
    protected $description = 'Create a new permission interface for the specified module';
25
26
    /**
27
     * The name of the generated resource.
28
     *
29
     * @var string
30
     */
31
    protected $generatorName = 'permission';
32
33
    /**
34
     * The stub name.
35
     *
36
     * @var string
37
     */
38
    protected $stub = 'permission.stub';
39
40
    /**
41
     * The file path.
42
     *
43
     * @var string
44
     */
45
    protected $filePath = '/Permissions';
46
47
    /**
48
     * The event that will fire when the file is created.
49
     *
50
     * @var string
51
     */
52
    protected $event = PermissionGeneratedEvent::class;
53
54
    protected function stubOptions(): array
55
    {
56
        return [
57
            'NAMESPACE' => $this->getClassNamespace(),
58
            'CLASS' => $this->getClassName(),
59
            'CAPPED_MODULE' => strtoupper($this->getModuleName()),
60
            'LOWER_MODULE'  => strtolower($this->getModuleName())
61
        ];
62
    }
63
}
64