ConfigFactory::newRootConfig()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 3
Bugs 1 Features 1
Metric Value
c 3
b 1
f 1
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 4
nc 1
nop 2
crap 1
1
<?php
2
namespace Bookdown\Bookdown\Config;
3
4
use Bookdown\Bookdown\Exception;
5
use Bookdown\Bookdown\Fsio;
6
7
class ConfigFactory
8
{
9
    protected $rootConfigOverrides = array();
10
11 2
    public function setRootConfigOverrides(array $rootConfigOverrides)
12
    {
13 2
        $this->rootConfigOverrides = $rootConfigOverrides;
14 2
    }
15
16 4
    public function newIndexConfig($file, $data)
17
    {
18 4
        return new IndexConfig($file, $data);
19
    }
20
21 5
    public function newRootConfig($file, $data)
22
    {
23 5
        $config = new RootConfig($file, $data);
24 5
        $config->setOverrides($this->rootConfigOverrides);
25 5
        return $config;
26
    }
27
}
28