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

CreateRouteCommand::getStub()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 14
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
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
}