Passed
Push — analysis-XNGW1g ( 55039c )
by Kyle
07:59 queued 32s
created

ServicesGenerator   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 33
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A generateService() 0 4 1
A handle() 0 6 1
1
<?php
2
3
namespace App\Console\Commands\Generator;
4
5
class ServicesGenerator extends BaseGenerator
6
{
7
    /**
8
     * The name and signature of the console command.
9
     *
10
     * @var string
11
     */
12
    protected $signature = 'make:services {name}';
13
14
    /**
15
     * The console command description.
16
     *
17
     * @var string
18
     */
19
    protected $description = 'Create a services file';
20
21
    /**
22
     * Execute the console command.
23
     *
24
     * @return mixed
25
     */
26
    public function handle()
27
    {
28
        $targetName = $this->getTargetName();
29
30
        $this->info("Create services: $targetName");
31
        $this->generateService($targetName);
32
    }
33
34
    protected function generateService($name)
35
    {
36
        $this->proceedAndSaveFile($name, 'services',
37
            $this->getServicesPath().ucwords($name).'Services.php');
38
    }
39
}
40