Completed
Push — develop ( 792e1e...b16138 )
by Peter
01:45
created

Developer::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 2
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace WebinoDev\Config\App;
4
5
/**
6
 * Application developer config
7
 */
8
class Developer
9
{
10
    /**
11
     * @var array
12
     */
13
    protected $options = [];
14
15
    /**
16
     * @param array|object $options
17
     */
18
    public function __construct($options)
19
    {
20
        $this->options = is_object($options) ? $options->toArray() : $options;
21
    }
22
23
    /**
24
     * @return array
25
     */
26
    public function toArray()
27
    {
28
        return array_replace_recursive(
29
            $this->options,
30
            [
31
                'modules' => [
32
                    110 => 'WebinoDev',
33
                    130 => 'AssetManager',
34
                ],
35
                'module_listener_options' => [
36
                    'config_cache_enabled'     => false,
37
                    'module_map_cache_enabled' => false,
38
                    'check_dependencies'       => true,
39
                ],
40
                'webino_debug' => [
41
                    'enabled' => 'cli' !== PHP_SAPI,
42
                    'mode'    => false,
43
                    'bar'     => true,
44
                ],
45
            ]
46
        );
47
    }
48
}
49