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

StorageConfig::hasServer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 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
}