Completed
Push — master ( 258f12...7b78be )
by Alejandro
17s queued 11s
created

AppOptions::getVersion()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
ccs 2
cts 2
cp 1
crap 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Shlinkio\Shlink\Core\Options;
5
6
use Shlinkio\Shlink\Common\Util\StringUtilsTrait;
7
use Zend\Stdlib\AbstractOptions;
8
use function sprintf;
9
10
class AppOptions extends AbstractOptions
11
{
12
    use StringUtilsTrait;
13
14
    /** @var string */
15
    private $name = '';
16
    /** @var string */
17
    private $version = '1.0';
18
    /**
19
     * @var string
20
     * @deprecated
21
     */
22
    private $secretKey = '';
23
    /** @var string|null */
24
    private $disableTrackParam;
25
26 2
    public function getName(): string
27
    {
28 2
        return $this->name;
29
    }
30
31 6
    protected function setName(string $name): self
32
    {
33 6
        $this->name = $name;
34 6
        return $this;
35
    }
36
37 2
    public function getVersion(): string
38
    {
39 2
        return $this->version;
40
    }
41
42 6
    protected function setVersion(string $version): self
43
    {
44 6
        $this->version = $version;
45 6
        return $this;
46
    }
47
48
    /**
49
     * @deprecated
50
     */
51 6
    public function getSecretKey(): string
52
    {
53 6
        return $this->secretKey;
0 ignored issues
show
Deprecated Code introduced by
The property Shlinkio\Shlink\Core\Opt...\AppOptions::$secretKey has been deprecated. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

53
        return /** @scrutinizer ignore-deprecated */ $this->secretKey;
Loading history...
54
    }
55
56
    /**
57
     * @deprecated
58
     */
59 6
    protected function setSecretKey(string $secretKey): self
60
    {
61 6
        $this->secretKey = $secretKey;
0 ignored issues
show
Deprecated Code introduced by
The property Shlinkio\Shlink\Core\Opt...\AppOptions::$secretKey has been deprecated. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

61
        /** @scrutinizer ignore-deprecated */ $this->secretKey = $secretKey;
Loading history...
62 6
        return $this;
63
    }
64
65
    /**
66
     * @return string|null
67
     */
68 5
    public function getDisableTrackParam(): ?string
69
    {
70 5
        return $this->disableTrackParam;
71
    }
72
73 4
    protected function setDisableTrackParam(?string $disableTrackParam): self
74
    {
75 4
        $this->disableTrackParam = $disableTrackParam;
76 4
        return $this;
77
    }
78
79 7
    public function __toString(): string
80
    {
81 7
        return sprintf('%s:v%s', $this->name, $this->version);
82
    }
83
}
84