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

GenerateContentTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 16
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A generatePhpContent() 0 3 1
A savePhp() 0 3 1
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
}