PhpHandler::parseInline()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Incenteev\ParameterHandler\FileHandler;
4
5
class PhpHandler
6
{
7
    /**
8
     * {@inheritdoc}
9
     */
10
    public function load($filePath)
11
    {
12
        $data = include $filePath;
13
14
        if (is_int($data)) {
15
            return [];
16
        }
17
18
        return $data;
19
    }
20
21
    /**
22
     * {@inheritdoc}
23
     */
24
    public function save($filePath, $data)
25
    {
26
        $contents = sprintf("<?php\n// This file is auto-generated during the composer install\nreturn %s;\n", var_export($data, true));
27
28
        return file_put_contents($filePath, $contents);
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public function parseInline($value)
35
    {
36
        return $value;
37
    }
38
39
    /**
40
     * {@inheritdoc}
41
     */
42
    public function dumpInline($value)
43
    {
44
        return $value;
45
    }
46
}
47