Completed
Push — develop ( 2f1dbd...8bd922 )
by Peter
02:12 queued 20s
created

Local   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 53
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
B toArray() 0 27 1
1
<?php
2
3
namespace WebinoDev\Config\App;
4
5
use WebinoDev\Assetic\Cache\FilesystemCache;
6
use WebinoDev\Factory\ProfilingAdapterFactory;
7
use Zend\Db\Adapter\Adapter;
8
9
/**
10
 * Application local config
11
 */
12
class Local
13
{
14
    /**
15
     * @var string
16
     */
17
    protected $dir;
18
19
    /**
20
     * @var array
21
     */
22
    protected $override = [];
23
24
    /**
25
     * @param string $dir
26
     * @param array $override
27
     */
28
    public function __construct($dir, array $override = [])
29
    {
30
        $this->dir      = $dir;
31
        $this->override = $override;
32
    }
33
34
    /**
35
     * @return array
36
     */
37
    public function toArray()
38
    {
39
        return array_replace_recursive(
40
            [
41
                'service_manager' => [
42
                    'factories' => [Adapter::class => ProfilingAdapterFactory::class],
43
                ],
44
                'view_manager' => [
45
                    'display_not_found_reason' => true,
46
                    'display_exceptions'       => true,
47
                ],
48
                'asset_manager' => [
49
                    'caching' => [
50
                        'default' => [
51
                            'cache'   => 'FilePath',
52
                            'options' => ['dir' => $this->dir . '/../../public'],
53
                        ],
54
                        'favicon.ico' => [
55
                            'cache'   => FilesystemCache::class,
56
                            'options' => ['dir' => 'tmp/cache/common/assets'],
57
                        ],
58
                    ],
59
                ],
60
            ],
61
            $this->override
62
        );
63
    }
64
}
65