License::setCannot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Dominikb\ComposerLicenseChecker;
6
7
use DateTimeInterface;
8
9
class License
10
{
11
    /** @var string */
12
    protected $shortName;
13
    /** @var string[] */
14
    protected $can;
15
    /** @var string[] */
16
    protected $cannot;
17
    /** @var string[] */
18
    protected $must;
19
    /** @var string */
20
    protected $source;
21
    /** @var DateTimeInterface */
22
    protected $createdAt;
23
24 2
    public function __construct(string $shortName)
25
    {
26 2
        $this->shortName = $shortName;
27
    }
28
29
    /**
30
     * @return string
31
     */
32 1
    public function getShortName(): string
33
    {
34 1
        return $this->shortName;
35
    }
36
37
    /**
38
     * @param  string  $shortName
39
     * @return License
40
     */
41 3
    public function setShortName(string $shortName): self
42
    {
43 3
        $this->shortName = $shortName;
44
45 3
        return $this;
46
    }
47
48
    /**
49
     * @return string[]
50
     */
51 1
    public function getCan(): array
52
    {
53 1
        return $this->can;
54
    }
55
56
    /**
57
     * @param  string[]  $can
58
     * @return License
59
     */
60 5
    public function setCan(array $can): self
61
    {
62 5
        $this->can = $can;
63
64 5
        return $this;
65
    }
66
67
    /**
68
     * @return string[]
69
     */
70 1
    public function getCannot(): array
71
    {
72 1
        return $this->cannot;
73
    }
74
75
    /**
76
     * @param  string[]  $cannot
77
     * @return License
78
     */
79 5
    public function setCannot(array $cannot): self
80
    {
81 5
        $this->cannot = $cannot;
82
83 5
        return $this;
84
    }
85
86
    /**
87
     * @return string[]
88
     */
89 1
    public function getMust(): array
90
    {
91 1
        return $this->must;
92
    }
93
94
    /**
95
     * @param  string[]  $must
96
     * @return License
97
     */
98 5
    public function setMust(array $must): self
99
    {
100 5
        $this->must = $must;
101
102 5
        return $this;
103
    }
104
105
    /**
106
     * @return string
107
     */
108 3
    public function getSource(): string
109
    {
110 3
        return $this->source;
111
    }
112
113
    /**
114
     * @param  string  $source
115
     * @return License
116
     */
117 5
    public function setSource(string $source): self
118
    {
119 5
        $this->source = $source;
120
121 5
        return $this;
122
    }
123
124
    /**
125
     * @return DateTimeInterface
126
     */
127 1
    public function getCreatedAt(): DateTimeInterface
128
    {
129 1
        return $this->createdAt;
130
    }
131
132
    /**
133
     * @param  DateTimeInterface  $createdAt
134
     * @return License
135
     */
136 5
    public function setCreatedAt(DateTimeInterface $createdAt): self
137
    {
138 5
        $this->createdAt = $createdAt;
139
140 5
        return $this;
141
    }
142
}
143