Completed
Push — master ( 83bd2d...9517e2 )
by Arne
03:10
created

ConnectionConfiguration::setTitle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace Archivr;
4
5
class ConnectionConfiguration
6
{
7
    /**
8
     * @var string
9
     */
10
    protected $title;
11
12
    /**
13
     * @var string
14
     */
15
    protected $vaultAdapter;
16
17
    /**
18
     * @var string
19
     */
20
    protected $lockAdapter;
21
22
    /**
23
     * @var array
24
     */
25
    protected $settings;
26
27
    public function __construct(string $vaultAdapter, string $lockAdapter)
28
    {
29
        $this->title = $vaultAdapter;
30
        $this->vaultAdapter = $vaultAdapter;
31
        $this->lockAdapter = $lockAdapter;
32
    }
33
34
    public function getTitle(): string
35
    {
36
        return $this->title;
37
    }
38
39
    public function setTitle(string $title): ConnectionConfiguration
40
    {
41
        $this->title = $title;
42
43
        return $this;
44
    }
45
46
    public function getVaultAdapter(): string
47
    {
48
        return $this->vaultAdapter;
49
    }
50
51
    public function setVaultAdapter(string $vaultAdapter): ConnectionConfiguration
52
    {
53
        $this->vaultAdapter = $vaultAdapter;
54
55
        return $this;
56
    }
57
58
    public function getLockAdapter(): string
59
    {
60
        return $this->lockAdapter;
61
    }
62
63
    public function setLockAdapter(string $lockAdapter): ConnectionConfiguration
64
    {
65
        $this->lockAdapter = $lockAdapter;
66
67
        return $this;
68
    }
69
70
    public function getSettings(): array
71
    {
72
        return $this->settings;
73
    }
74
75
    public function getSetting(string $name)
76
    {
77
        return isset($this->settings[$name]) ? $this->settings[$name] : null;
78
    }
79
80
    public function setSettings(array $settings): ConnectionConfiguration
81
    {
82
        $this->settings = $settings;
83
84
        return $this;
85
    }
86
87
    public function setSetting(string $name, $value): ConnectionConfiguration
88
    {
89
        $this->settings[$name] = $value;
90
91
        return $this;
92
    }
93
}
94