PHP   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

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