Completed
Push — master ( 96faaf...c1c325 )
by Alejandro
03:51
created

AppOptions   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 88
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
dl 0
loc 88
ccs 20
cts 20
cp 1
rs 10
c 2
b 0
f 0
wmc 8
lcom 0
cbo 2

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getName() 0 4 1
A setName() 0 5 1
A getVersion() 0 4 1
A setVersion() 0 5 1
A getSecretKey() 0 4 1
A setSecretKey() 0 5 1
A __toString() 0 4 1
1
<?php
2
namespace Shlinkio\Shlink\Core\Options;
3
4
use Shlinkio\Shlink\Common\Util\StringUtilsTrait;
5
use Zend\Stdlib\AbstractOptions;
6
7
class AppOptions extends AbstractOptions
8
{
9
    use StringUtilsTrait;
10
11
    /**
12
     * @var string
13
     */
14
    protected $name = '';
15
    /**
16
     * @var string
17
     */
18
    protected $version = '1.0';
19
    /**
20
     * @var string
21
     */
22
    protected $secretKey = '';
23
24
    /**
25
     * AppOptions constructor.
26
     * @param array|null|\Traversable $options
27
     */
28 15
    public function __construct($options = null)
29
    {
30 15
        parent::__construct($options);
31 15
    }
32
33
    /**
34
     * @return string
35
     */
36 2
    public function getName()
37
    {
38 2
        return $this->name;
39
    }
40
41
    /**
42
     * @param string $name
43
     * @return $this
44
     */
45 6
    protected function setName($name)
46
    {
47 6
        $this->name = $name;
48 6
        return $this;
49
    }
50
51
    /**
52
     * @return string
53
     */
54 2
    public function getVersion()
55
    {
56 2
        return $this->version;
57
    }
58
59
    /**
60
     * @param string $version
61
     * @return $this
62
     */
63 6
    protected function setVersion($version)
64
    {
65 6
        $this->version = $version;
66 6
        return $this;
67
    }
68
69
    /**
70
     * @return mixed
71
     */
72 6
    public function getSecretKey()
73
    {
74 6
        return $this->secretKey;
75
    }
76
77
    /**
78
     * @param mixed $secretKey
79
     * @return $this
80
     */
81 6
    protected function setSecretKey($secretKey)
82
    {
83 6
        $this->secretKey = $secretKey;
84 6
        return $this;
85
    }
86
87
    /**
88
     * @return string
89
     */
90 7
    public function __toString()
91
    {
92 7
        return sprintf('%s:v%s', $this->name, $this->version);
93
    }
94
}
95