Completed
Push — master ( e0759a...dc0dc9 )
by Sergi Tur
04:57
created

BaseCommand::findLlum()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 7
nc 3
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
 * @package Acacha\AdminLTETemplateLaravel\Console
12
 */
13
class BaseCommand extends Command
14
{
15
    use Paths;
16
17
    /**
18
     * Install development version.
19
     *
20
     * @var bool
21
     */
22
    protected $installDev = false;
23
24
    /**
25
     * Get llum package name.
26
     */
27
    protected function getPackageName()
28
    {
29
        return 'laravel-social';
30
    }
31
32
    /**
33
     * Get the llum command for the environment.
34
     *
35
     * @return string
36
     */
37
    protected function findLlum()
38
    {
39
        $HOME = $this->getUserHomePath();
40
        if (is_executable($this->getRealPath("$HOME/.composer/vendor/bin/llum"))) {
41
            return "$HOME/.composer/vendor/bin/llum";
42
        }
43
        if (is_executable($this->getRealPath("$HOME/.config/composer/vendor/bin/llum"))) {
44
            return "$HOME/.config/composer/vendor/bin/llum";
45
        }
46
47
        return 'llum';
48
    }
49
50
    /**
51
     * Gets dev option.
52
     *
53
     * @return string
54
     */
55
    protected function getDevOption()
56
    {
57
        return $this->installDev ? '--dev' : '';
58
    }
59
}