Completed
Push — master ( f02869...8251a6 )
by Nicolas
03:31
created

ProtectInstaller::fire()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 3
nc 2
nop 1
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php namespace Modules\Core\Console\Installers\Scripts;
2
3
use Exception;
4
use Illuminate\Console\Command;
5
use Illuminate\Filesystem\Filesystem;
6
use Modules\Core\Console\Installers\SetupScript;
7
8
class ProtectInstaller implements SetupScript
9
{
10
    /**
11
     * @var Filesystem
12
     */
13
    protected $finder;
14
15
    /**
16
     * @param Filesystem $finder
17
     */
18
    public function __construct(Filesystem $finder)
19
    {
20
        $this->finder = $finder;
21
    }
22
23
    /**
24
     * Fire the install script
25
     * @param  Command   $command
26
     * @return mixed
27
     * @throws Exception
28
     */
29
    public function fire(Command $command)
30
    {
31
        if ($this->finder->isFile('.env') && ! $command->option('force')) {
32
            throw new Exception('Asgard has already been installed. You can already log into your administration.');
33
        }
34
    }
35
}
36