Passed
Push — master ( d33d35...37f9e4 )
by Dominik
01:18
created

License::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 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
    public function __construct(string $shortName)
25
    {
26
        $this->shortName = $shortName;
27
    }
28
29
    /**
30
     * @return string
31
     */
32
    public function getShortName(): string
33
    {
34
        return $this->shortName;
35
    }
36
37
    /**
38
     * @param string $shortName
39
     *
40
     * @return License
41
     */
42
    public function setShortName(string $shortName): self
43
    {
44
        $this->shortName = $shortName;
45
46
        return $this;
47
    }
48
49
    /**
50
     * @return string[]
51
     */
52
    public function getCan(): array
53
    {
54
        return $this->can;
55
    }
56
57
    /**
58
     * @param string[] $can
59
     *
60
     * @return License
61
     */
62
    public function setCan(array $can): self
63
    {
64
        $this->can = $can;
65
66
        return $this;
67
    }
68
69
    /**
70
     * @return string[]
71
     */
72
    public function getCannot(): array
73
    {
74
        return $this->cannot;
75
    }
76
77
    /**
78
     * @param string[] $cannot
79
     *
80
     * @return License
81
     */
82
    public function setCannot(array $cannot): self
83
    {
84
        $this->cannot = $cannot;
85
86
        return $this;
87
    }
88
89
    /**
90
     * @return string[]
91
     */
92
    public function getMust(): array
93
    {
94
        return $this->must;
95
    }
96
97
    /**
98
     * @param string[] $must
99
     *
100
     * @return License
101
     */
102
    public function setMust(array $must): self
103
    {
104
        $this->must = $must;
105
106
        return $this;
107
    }
108
109
    /**
110
     * @return string
111
     */
112
    public function getSource(): string
113
    {
114
        return $this->source;
115
    }
116
117
    /**
118
     * @param string $source
119
     *
120
     * @return License
121
     */
122
    public function setSource(string $source): self
123
    {
124
        $this->source = $source;
125
126
        return $this;
127
    }
128
129
    /**
130
     * @return DateTimeInterface
131
     */
132
    public function getCreatedAt(): DateTimeInterface
133
    {
134
        return $this->createdAt;
135
    }
136
137
    /**
138
     * @param DateTimeInterface $createdAt
139
     *
140
     * @return License
141
     */
142
    public function setCreatedAt(DateTimeInterface $createdAt): self
143
    {
144
        $this->createdAt = $createdAt;
145
146
        return $this;
147
    }
148
}
149