Completed
Pull Request — master (#96)
by
unknown
03:45
created

SetInstalledFlag::fire()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 6
rs 9.4285
1
<?php
2
3
namespace Modules\Core\Console\Installers\Scripts;
4
5
use Illuminate\Console\Command;
6
use Illuminate\Filesystem\Filesystem;
7
use Modules\Core\Console\Installers\SetupScript;
8
9
class SetInstalledFlag implements SetupScript
10
{
11
    /**
12
     * @var Filesystem
13
     */
14
    private $finder;
15
16
    public function __construct(Filesystem $finder)
17
    {
18
        $this->finder = $finder;
19
    }
20
21
    /**
22
     * Fire the install script
23
     * @param  Command $command
24
     * @return mixed
25
     */
26
    public function fire(Command $command)
27
    {
28
        $env = $this->finder->get('.env');
29
        $env = str_replace('INSTALLED=false', 'INSTALLED=true', $env);
30
        $this->finder->put('.env', $env);
31
    }
32
}
33