DevTools   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A devtools() 0 9 3
A idehelper() 0 4 1
A debugbar() 0 4 1
package() 0 1 ?
1
<?php
2
3
namespace Acacha\Llum\Traits;
4
5
/**
6
 * Class DevTools.
7
 */
8
trait DevTools
9
{
10
    /**
11
     * Execute devtools command.
12
     *
13
     * @return int -1 if error occurred
14
     */
15
    protected function devtools()
16
    {
17
        if ($this->idehelper() == -1) {
18
            return -1;
19
        }
20
        if ($this->debugbar() == -1) {
21
            return -1;
22
        }
23
    }
24
25
    /**
26
     *  Install Laravel ide helper package.
27
     *
28
     *  @return int -1 if error occurred
29
     */
30
    protected function idehelper()
31
    {
32
        return $this->package('barryvdh/laravel-ide-helper');
33
    }
34
35
    /**
36
     * Install Laravel debugbar package.
37
     *
38
     * @return int -1 if error occurred
39
     */
40
    protected function debugbar()
41
    {
42
        return $this->package('barryvdh/laravel-debugbar');
43
    }
44
45
    /**
46
     * Installs laravel package form config/packages.php file.
47
     *
48
     * @see Acacha\Llum\Console\LlumCommand::package
49
     *
50
     * @param $package
51
     *
52
     * @return mixed
53
     */
54
    abstract protected function package($package);
55
}
56