Completed
Push — master ( 265a2d...f9e310 )
by jerome
05:38 queued 02:58
created

SettingsFactory::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace DP\Core\CoreBundle\Settings;
4
5
class SettingsFactory
6
{
7
    /**
8
     * @var SettingsReader
9
     */
10
    private $reader;
11
12
    /**
13
     * @param SettingsReader $reader
14
     */
15
    public function __construct(SettingsReader $reader)
16
    {
17
        $this->reader = $reader;
18
    }
19
20
    /**
21
     * @return Settings
22
     */
23
    public function create()
24
    {
25
        $settings = $this->reader->read();
26
27
        return new Settings(isset($settings['debug']) ? $settings['debug'] : false);
28
    }
29
}
30