Completed
Push — master ( 061748...863025 )
by Vincenzo
02:39
created

CreateModelCommand::getStub()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
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 6
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\Helpers\TextFormatter;
8
use App\Lib\Slime\Console\GeneratorHelperCommand;
9
10
class CreateModelCommand extends GeneratorHelperCommand
11
{
12
    protected function getFileName()
13
    {
14
        return TextFormatter::snakeToCamelCase($this->getArg(0));
15
    }
16
17
18
    protected function getHead()
19
    {
20
        $fileHead = parent::getHead();
21
        $fileHead .= PHP_EOL . 'namespace App\Models;' . PHP_EOL . 'use App\Lib\Slime\Models\SlimeModel;' . PHP_EOL;
22
        return $fileHead;
23
    }
24
25
    protected function getFilePath()
26
    {
27
        return 'Models/';
28
    }
29
30
    protected function getStub()
31
    {
32
        return PHP_EOL . 'class ' .
33
        TextFormatter::snakeToCamelCase($this->getArg(0)) .
34
        ' extends SlimeModel {' . PHP_EOL . '}';
35
    }
36
37
38
}