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

Local::toArray()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 27
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 16
nc 1
nop 0
dl 0
loc 27
rs 8.8571
c 0
b 0
f 0
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