Passed
Push — master ( cd2210...3cb518 )
by Thomas
39s
created

MakeBackpackCrudRequest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 78
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 78
ccs 0
cts 18
cp 0
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getPath() 0 6 1
A getStub() 0 4 1
A getDefaultNamespace() 0 4 1
A getOptions() 0 6 1
1
<?php
2
3
namespace Webfactor\Laravel\Generators\Commands;
4
5
use Illuminate\Console\GeneratorCommand;
6
7
class MakeBackpackCrudRequest extends GeneratorCommand
8
{
9
    /**
10
     * The console command name.
11
     *
12
     * @var string
13
     */
14
    protected $name = 'make:crud-request';
15
16
    /**
17
     * The name and signature of the console command.
18
     *
19
     * @var string
20
     */
21
    protected $signature = 'make:crud-request {name}';
22
23
    /**
24
     * The console command description.
25
     *
26
     * @var string
27
     */
28
    protected $description = 'Generate a Backpack CRUD request';
29
30
    /**
31
     * The type of class being generated.
32
     *
33
     * @var string
34
     */
35
    protected $type = 'Request';
36
37
    /**
38
     * Get the destination class path.
39
     *
40
     * @param string $name
41
     *
42
     * @return string
43
     */
44
    protected function getPath($name)
45
    {
46
        $name = str_replace($this->laravel->getNamespace(), '', $name);
47
48
        return $this->laravel['path'].'/'.str_replace('\\', '/', $name).'Request.php';
49
    }
50
51
    /**
52
     * Get the stub file for the generator.
53
     *
54
     * @return string
55
     */
56
    protected function getStub()
57
    {
58
        return __DIR__.'/../../stubs/crud-request.stub';
59
    }
60
61
    /**
62
     * Get the default namespace for the class.
63
     *
64
     * @param string $rootNamespace
65
     *
66
     * @return string
67
     */
68
    protected function getDefaultNamespace($rootNamespace)
69
    {
70
        return $rootNamespace.'\Http\Requests\Admin';
71
    }
72
73
    /**
74
     * Get the console command options.
75
     *
76
     * @return array
77
     */
78
    protected function getOptions()
79
    {
80
        return [
81
82
        ];
83
    }
84
}
85