Environment::put()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
nc 3
nop 0
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: polidog
5
 * Date: 2016/07/16.
6
 */
7
8
namespace Polidog\LaravelBundle;
9
10
class Environment
11
{
12
    private $env;
13
14
    private $booted;
15
16
    /**
17
     * PutEnv constructor.
18
     *
19
     * @param $env
20
     */
21
    public function __construct(array $env = [])
22
    {
23
        $this->env = $env;
24
25
        $this->booted = false;
26
    }
27
28
    public function put()
29
    {
30
        if (!$this->booted) {
31
            foreach ($this->env as $key => $value) {
32
                putenv("{$key}={$value}");
33
            }
34
            $this->booted = true;
35
        }
36
    }
37
38
}
39