PHP::doLoad()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
c 0
b 0
f 0
rs 9.4285
cc 3
eloc 6
nc 2
nop 0
1
<?php
2
namespace DICIT\Config;
3
4
class PHP extends AbstractConfig
5
{
6
    protected $filePath = null;
7
8
    public function __construct($filePath)
9
    {
10
        $this->filePath = $filePath;
11
    }
12
13
    protected function doLoad()
14
    {
15
        if (file_exists($this->filePath) && is_readable($this->filePath)) {
16
            $array = include $this->filePath;
17
            return $array;
18
        }
19
        else {
20
            throw new \RuntimeException("Couldn't load the array in path '" . $this->filePath . "'");
21
        }
22
    }
23
}
24