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

ProtectInstaller::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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