MakeActivatorCommand::getStub()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Console;
6
7
use Illuminate\Console\GeneratorCommand;
8
9
class MakeActivatorCommand extends GeneratorCommand
10
{
11
    protected $name = 'fondbot:make:activator';
12
    protected $description = 'Create a new intent activator class';
13
    protected $type = 'Activator';
14
15
    /**
16
     * Get the stub file for the generator.
17
     *
18
     * @return string
19
     */
20
    protected function getStub(): string
21
    {
22
        return __DIR__.'/../../resources/stubs/Activator.stub';
23
    }
24
25
    /**
26
     * Parse the class name and format according to the root namespace.
27
     *
28
     * @param  string  $name
29
     * @return string
30
     */
31
    protected function qualifyClass($name): string
32
    {
33
        return $name;
34
    }
35
36
    /**
37
     * Get the destination class path.
38
     *
39
     * @param  string  $name
40
     * @return string
41
     */
42
    protected function getPath($name): string
43
    {
44
        return $this->laravel['path'].'/Activators/'.$name.'.php';
45
    }
46
47
    /**
48
     * Get the full namespace for a given class, without the class name.
49
     *
50
     * @param  string  $name
51
     * @return string
52
     */
53
    protected function getNamespace($name): string
54
    {
55
        return 'Activators';
56
    }
57
}
58