Completed
Push — 2.0 ( 260628...4fde74 )
by Nicolas
03:20
created

SetInstalledFlag::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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