YMLInline::compile()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
namespace DICIT\Config;
3
4
class YMLInline extends AbstractConfig
5
{
6
    protected $inline = '';
7
    protected $data = array();
8
9
    public function __construct($string)
10
    {
11
        $this->inline = $string;
12
    }
13
14
    protected function doLoad()
15
    {
16
        return $this->loadInline($this->inline);
17
    }
18
19
    protected function loadInline($inline)
20
    {
21
        $yaml = new \Symfony\Component\Yaml\Yaml();
22
        $res = $yaml->parse($inline);
23
        return $res;
24
    }
25
26
    public function compile()
27
    {
28
        $ret = $this->load();
29
        $dump = var_export($ret, true);
30
        return $dump;
31
    }
32
}
33