Completed
Push — 2.0 ( 260628...4fde74 )
by Nicolas
03:20
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 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