Completed
Branch develop (c2aa4c)
by Anton
05:17
created

StorageConfig   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 41
wmc 3
lcom 1
cbo 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A hasServer() 0 4 1
A serverOptions() 0 4 1
A getBuckets() 0 4 1
1
<?php
2
/**
3
 * Spiral Framework.
4
 *
5
 * @license MIT
6
 * @author  Anton Titov (Wolfy-J)
7
 */
8
namespace Spiral\Storage\Configs;
9
10
use Spiral\Core\InjectableConfig;
11
12
/**
13
 * Storage manager configuration.
14
 */
15
class StorageConfig extends InjectableConfig
16
{
17
    /**
18
     * Configuration section.
19
     */
20
    const CONFIG = 'storage';
21
22
    /**
23
     * @var array
24
     */
25
    protected $config = [
26
        'servers' => [],
27
        'buckets' => []
28
    ];
29
30
    /**
31
     * @param string $server
32
     * @return bool
33
     */
34
    public function hasServer($server)
35
    {
36
        return isset($this->config['servers'][$server]);
37
    }
38
39
    /**
40
     * @param string $server
41
     * @return array
42
     */
43
    public function serverOptions($server)
44
    {
45
        return $this->config['servers'][$server];
46
    }
47
48
    /**
49
     * @return array
50
     */
51
    public function getBuckets()
52
    {
53
        return $this->config['buckets'];
54
    }
55
}