Completed
Push — master ( 9ecb5e...97e3cb )
by Sherif
13:30
created

MakeNotificationsCommand   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 64
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 64
rs 10
c 1
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getStub() 0 4 1
A getPath() 0 4 1
A qualifyClass() 0 4 1
A getNamespace() 0 4 1
1
<?php namespace App\Modules\V1\Notifications\Console\Commands;
2
3
use Caffeinated\Modules\Console\GeneratorCommand;
4
5
class MakeNotificationsCommand extends GeneratorCommand
6
{
7
    /**
8
     * The name and signature of the console command.
9
     *
10
     * @var string
11
     */
12
    protected $signature = 'make:module:notification
13
        {name : The name of the notification class.}';
14
    /**
15
     * The console command description.
16
     *
17
     * @var string
18
     */
19
    protected $description = 'Create a new module notification class';
20
    /**
21
     * String to store the command type.
22
     *
23
     * @var string
24
     */
25
    protected $type = 'Module notification';
26
    /**
27
     * Get the stub file for the generator.
28
     *
29
     * @return string
30
     */
31
    protected function getStub()
32
    {
33
        return __DIR__.'/stubs/notification.stub';
34
    }
35
    /**
36
     * Get the destination class path.
37
     *
38
     * @param string $name
39
     *
40
     * @return string
41
     */
42
    protected function getPath($name)
43
    {
44
        return module_path('notifications', 'Notifications/'.$name.'.php');
45
    }
46
    /**
47
     * Parse the name and format according to the root namespace.
48
     *
49
     * @param string $name
50
     *
51
     * @return string
52
     */
53
    protected function qualifyClass($name)
54
    {
55
        return $name;
56
    }
57
    /**
58
     * Replace namespace in notification stub.
59
     *
60
     * @param string $name
61
     *
62
     * @return string
63
     */
64
    protected function getNamespace($name)
65
    {
66
        return module_class('notifications', 'Notifications');
67
    }
68
}