YMLInline   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 29
c 0
b 0
f 0
wmc 4
lcom 1
cbo 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A doLoad() 0 4 1
A loadInline() 0 6 1
A compile() 0 6 1
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