Completed
Push — master ( 3e25f8...e7bd0a )
by Sergi Tur
02:09
created

BaseCommand::getPackageName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Acacha\AdminLTETemplateLaravel\Console;
4
5
use Acacha\AdminLTETemplateLaravel\Console\Traits\Paths;
6
use Symfony\Component\Console\Command\Command;
7
8
/**
9
 * Class BaseCommand.
10
 */
11
class BaseCommand extends Command
12
{
13
    use Paths;
14
15
    /**
16
     * Install development version.
17
     *
18
     * @var bool
19
     */
20
    protected $installDev = false;
21
22
    /**
23
     * Get the llum command for the environment.
24
     *
25
     * @return string
26
     */
27
    protected function findLlum()
28
    {
29
        $HOME = $this->getUserHomePath();
30
        if (is_executable($this->getRealPath("$HOME/.composer/vendor/bin/llum"))) {
31
            return "$HOME/.composer/vendor/bin/llum";
32
        }
33
        if (is_executable($this->getRealPath("$HOME/.config/composer/vendor/bin/llum"))) {
34
            return "$HOME/.config/composer/vendor/bin/llum";
35
        }
36
37
        return 'llum';
38
    }
39
40
    /**
41
     * Gets dev option.
42
     *
43
     * @return string
44
     */
45
    protected function getDevOption()
46
    {
47
        return $this->installDev ? '--dev' : '';
48
    }
49
}
50