Filesystem   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 16 2
1
<?php
2
/**
3
 * Webino™ (http://webino.sk)
4
 *
5
 * @link        https://github.com/webino for the canonical source repository
6
 * @copyright   Copyright (c) 2015-2017 Webino, s.r.o. (http://webino.sk)
7
 * @author      Peter Bačinský <[email protected]>
8
 * @license     BSD-3-Clause
9
 */
10
11
namespace WebinoConfigLib\Cache;
12
13
use WebinoConfigLib\AbstractConfig;
14
15
/**
16
 * Class Filesystem
17
 */
18
class Filesystem extends AbstractConfig
19
{
20
    /**
21
     * @param string $namespace
22
     * @param string|null $dir
23
     */
24
    public function __construct($namespace, $dir = null)
25
    {
26
        $this->mergeArray([
27
            'adapter' => [
28
                'name' => 'filesystem',
29
                'options' => [
30
                    'namespace'       => $namespace,
31
                    'cacheDir'       => is_null($dir) ? 'data/cache' : $dir,
32
                    'dirPermission'  => false,
33
                    'filePermission' => false,
34
                    'umask'           => 7,
35
                ],
36
            ],
37
            'plugins' => ['serializer'],
38
        ]);
39
    }
40
}
41