Passed
Push — master ( 28f242...472b4c )
by Gabriel
04:44
created

GenerateContentTrait::savePhp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace ByTIC\Migrations\Config\Traits;
4
5
/**
6
 * Trait GenerateContentTrait
7
 * @package ByTIC\Migrations\Config\Traits
8
 */
9
trait GenerateContentTrait
10
{
11
    /**
12
     * @param $configPath
13
     */
14 1
    public function savePhp($configPath)
15
    {
16 1
        file_put_contents($configPath, $this->generatePhpContent());
17 1
    }
18
19
    /**
20
     * @return string
21
     */
22 1
    public function generatePhpContent()
23
    {
24 1
        return '<?php return ' . var_export($this->params, true) . ';' . PHP_EOL;
25
    }
26
}