Package   C
last analyzed

Complexity

Total Complexity 30

Size/Duplication

Total Lines 317
Duplicated Lines 0 %

Coupling/Cohesion

Components 15
Dependencies 2

Importance

Changes 0
Metric Value
wmc 30
lcom 15
cbo 2
dl 0
loc 317
rs 5
c 0
b 0
f 0

30 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 4 1
A setName() 0 5 1
A getDescription() 0 4 1
A setDescription() 0 5 1
A getTime() 0 4 1
A setTime() 0 5 1
A getMaintainers() 0 4 1
A setMaintainers() 0 5 1
A getVersion() 0 4 1
A setVersion() 0 5 1
A getVersions() 0 4 1
A setVersions() 0 5 1
A getType() 0 4 1
A setType() 0 5 1
A getRepository() 0 4 1
A setRepository() 0 5 1
A getGithub() 0 4 1
A setGithub() 0 5 1
A getLanguage() 0 4 1
A setLanguage() 0 5 1
A getDependents() 0 4 1
A setDependents() 0 5 1
A getSuggesters() 0 4 1
A setSuggesters() 0 5 1
A getDownloads() 0 4 1
A setDownloads() 0 5 1
A getFavers() 0 4 1
A setFavers() 0 5 1
A getUrl() 0 4 1
A setUrl() 0 5 1
1
<?php
2
/**
3
 * This file is part of the wow-apps/symfony-packagist project
4
 * https://github.com/wow-apps/symfony-packagist
5
 *
6
 * (c) 2017 WoW-Apps
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WowApps\PackagistBundle\DTO;
13
14
/**
15
 * Class Package
16
 *
17
 * @author Alexey Samara <[email protected]>
18
 * @package wow-apps/symfony-packagist
19
 */
20
class Package
21
{
22
    /** @var string */
23
    private $name;
24
25
    /** @var string */
26
    private $description;
27
28
    /** @var string */
29
    private $time;
30
31
    /** @var \ArrayObject|PackageMaintainer[] */
32
    private $maintainers;
33
34
    /** @var string */
35
    private $version;
36
37
    /** @var \ArrayObject|PackageVersion[] */
38
    private $versions;
39
40
    /** @var string */
41
    private $type;
42
43
    /** @var string */
44
    private $repository;
45
46
    /** @var string */
47
    private $url;
48
49
    /** @var GitHubStat */
50
    private $github;
51
52
    /** @var string */
53
    private $language;
54
55
    /** @var int */
56
    private $dependents;
57
58
    /** @var int */
59
    private $suggesters;
60
61
    /** @var DownloadsStat */
62
    private $downloads;
63
64
    /** @var int */
65
    private $favers;
66
67
    /**
68
     * @return string
69
     */
70
    public function getName(): string
71
    {
72
        return $this->name ?? '';
73
    }
74
75
    /**
76
     * @param string $name
77
     * @return Package
78
     */
79
    public function setName(string $name): Package
80
    {
81
        $this->name = $name;
82
        return $this;
83
    }
84
85
    /**
86
     * @return string
87
     */
88
    public function getDescription(): string
89
    {
90
        return $this->description ?? '';
91
    }
92
93
    /**
94
     * @param string $description
95
     * @return Package
96
     */
97
    public function setDescription(string $description): Package
98
    {
99
        $this->description = $description;
100
        return $this;
101
    }
102
103
    /**
104
     * @return string
105
     */
106
    public function getTime(): string
107
    {
108
        return $this->time ?? '';
109
    }
110
111
    /**
112
     * @param string $time
113
     * @return Package
114
     */
115
    public function setTime(string $time): Package
116
    {
117
        $this->time = $time;
118
        return $this;
119
    }
120
121
    /**
122
     * @return \ArrayObject|PackageMaintainer[]
123
     */
124
    public function getMaintainers()
125
    {
126
        return $this->maintainers ?? new \ArrayObject();
127
    }
128
129
    /**
130
     * @param \ArrayObject|PackageMaintainer[] $maintainers
131
     * @return Package
132
     */
133
    public function setMaintainers($maintainers)
134
    {
135
        $this->maintainers = $maintainers;
136
        return $this;
137
    }
138
139
    /**
140
     * @return string
141
     */
142
    public function getVersion(): string
143
    {
144
        return $this->version ?? '';
145
    }
146
147
    /**
148
     * @param string $version
149
     * @return Package
150
     */
151
    public function setVersion(string $version): Package
152
    {
153
        $this->version = $version;
154
        return $this;
155
    }
156
157
    /**
158
     * @return \ArrayObject|PackageVersion[]
159
     */
160
    public function getVersions()
161
    {
162
        return $this->versions ?? new \ArrayObject();
163
    }
164
165
    /**
166
     * @param \ArrayObject|PackageVersion[] $versions
167
     * @return Package
168
     */
169
    public function setVersions($versions)
170
    {
171
        $this->versions = $versions;
172
        return $this;
173
    }
174
175
    /**
176
     * @return string
177
     */
178
    public function getType(): string
179
    {
180
        return $this->type ?? '';
181
    }
182
183
    /**
184
     * @param string $type
185
     * @return Package
186
     */
187
    public function setType(string $type): Package
188
    {
189
        $this->type = $type;
190
        return $this;
191
    }
192
193
    /**
194
     * @return string
195
     */
196
    public function getRepository(): string
197
    {
198
        return $this->repository ?? '';
199
    }
200
201
    /**
202
     * @param string $repository
203
     * @return Package
204
     */
205
    public function setRepository(string $repository): Package
206
    {
207
        $this->repository = $repository;
208
        return $this;
209
    }
210
211
    /**
212
     * @return GitHubStat
213
     */
214
    public function getGithub(): GitHubStat
215
    {
216
        return $this->github ?? new GitHubStat();
217
    }
218
219
    /**
220
     * @param GitHubStat $github
221
     * @return Package
222
     */
223
    public function setGithub(GitHubStat $github): Package
224
    {
225
        $this->github = $github;
226
        return $this;
227
    }
228
229
    /**
230
     * @return string
231
     */
232
    public function getLanguage(): string
233
    {
234
        return $this->language ?? '';
235
    }
236
237
    /**
238
     * @param string $language
239
     * @return Package
240
     */
241
    public function setLanguage(string $language): Package
242
    {
243
        $this->language = $language;
244
        return $this;
245
    }
246
247
    /**
248
     * @return int
249
     */
250
    public function getDependents(): int
251
    {
252
        return $this->dependents ?? 0;
253
    }
254
255
    /**
256
     * @param int $dependents
257
     * @return Package
258
     */
259
    public function setDependents(int $dependents): Package
260
    {
261
        $this->dependents = $dependents;
262
        return $this;
263
    }
264
265
    /**
266
     * @return int
267
     */
268
    public function getSuggesters(): int
269
    {
270
        return $this->suggesters ?? 0;
271
    }
272
273
    /**
274
     * @param int $suggesters
275
     * @return Package
276
     */
277
    public function setSuggesters(int $suggesters): Package
278
    {
279
        $this->suggesters = $suggesters;
280
        return $this;
281
    }
282
283
    /**
284
     * @return DownloadsStat
285
     */
286
    public function getDownloads(): DownloadsStat
287
    {
288
        return $this->downloads ?? new DownloadsStat();
289
    }
290
291
    /**
292
     * @param DownloadsStat $downloads
293
     * @return Package
294
     */
295
    public function setDownloads(DownloadsStat $downloads): Package
296
    {
297
        $this->downloads = $downloads;
298
        return $this;
299
    }
300
301
    /**
302
     * @return int
303
     */
304
    public function getFavers(): int
305
    {
306
        return $this->favers ?? 0;
307
    }
308
309
    /**
310
     * @param int $favers
311
     * @return Package
312
     */
313
    public function setFavers(int $favers): Package
314
    {
315
        $this->favers = $favers;
316
        return $this;
317
    }
318
319
    /**
320
     * @return string
321
     */
322
    public function getUrl(): string
323
    {
324
        return $this->url ?? '';
325
    }
326
327
    /**
328
     * @param string $url
329
     * @return Package
330
     */
331
    public function setUrl(string $url): Package
332
    {
333
        $this->url = $url;
334
        return $this;
335
    }
336
}
337