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

SetInstalledFlag   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 24
rs 10
wmc 2
lcom 1
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A fire() 0 6 1
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