Passed
Push — master ( 1eab0f...766e74 )
by Php Easy Api
03:09
created

Helper   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 44
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 14 2
1
<?php
2
3
namespace Resta\Console\Source\Helper;
4
5
use Resta\Support\Utils;
6
use Resta\Console\ConsoleOutputter;
7
use Resta\Console\ConsoleListAccessor;
8
use Resta\Foundation\PathManager\StaticPathModel;
9
10
class Helper extends ConsoleOutputter
11
{
12
13
    use ConsoleListAccessor;
14
15
    /**
16
     * @var string
17
     */
18
    public $type = 'helper';
19
20
    /**
21
     * @var array
22
     */
23
    protected $runnableMethods = [
24
        'create'=>'Creates a helper file'
25
    ];
26
27
    /**
28
     * @var bool
29
     */
30
    protected $projectStatus = true;
31
32
    /**
33
     * @var array
34
     */
35
    public $commandRule=['helper'];
36
37
    /**
38
     * @return mixed
39
     */
40
    public function create()
41
    {
42
43
        if(!file_exists(app()->path()->helpers())){
44
            $this->directory['helper']          = app()->path()->helpers();
45
            $this->file->makeDirectory($this);
46
        }
47
48
        $this->touch['helpers/general']= app()->path()->helpers().'/'.ucfirst($this->argument['helper']).'.php';
49
50
51
        $this->file->touch($this);
52
53
        echo $this->classical(' > Helper called as "'.$this->argument['helper'].'" has been successfully created in the '.app()->namespace()->helpers().'');
54
55
    }
56
}