FileLoader::save()   A
last analyzed

Complexity

Conditions 4
Paths 5

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 11
rs 9.2
cc 4
eloc 6
nc 5
nop 4
1
<?php namespace jlourenco\support\Helpers;
2
3
class FileLoader extends \Illuminate\Config\FileLoader
4
{
5
6
    public function save($items, $environment, $group, $namespace = null)
7
    {
8
        $path = $this->getPath($namespace);
9
10
        if (is_null($path))
11
            return;
12
13
        $file = (!$environment || ($environment == 'production')) ? "{$path}/{$group}.php" : "{$path}/{$environment}/{$group}.php";
14
15
        $this->files->put($file, '<?php return ' . var_export($items, true) . ';');
16
    }
17
18
}