Completed
Push — master ( d38b33...d045d3 )
by Vincenzo
02:36
created

CreateRouteCommand   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getFilePath() 0 4 1
A getFileName() 0 4 1
A getStub() 0 14 1
1
<?php
2
3
4
namespace App\Lib\Slime\Console\Commands;
5
6
7
use App\Lib\Slime\Console\GeneratorHelperCommand;
8
9
class CreateRouteCommand extends GeneratorHelperCommand
10
{
11
    protected function getFilePath()
12
    {
13
        return 'routes/' . $this->getArg(0) . '/';
14
    }
15
16
    protected function getFileName()
17
    {
18
        return 'routes';
19
    }
20
21
    protected function getStub()
22
    {
23
        return PHP_EOL .
24
        '$api->get(\'/'.$this->getArg(0).'\', function ($request, $response, $args) {
25
            return (
26
                new SOMEACTION(
27
                    $request,
28
                    $response,
29
                    $args
30
                )
31
             )->execute();
32
             });'
33
        . PHP_EOL;
34
    }
35
36
37
}