DevTools::debugbar()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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