Total Complexity | 5 |
Total Lines | 66 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | class DownloadStatistics extends Statistics |
||
8 | { |
||
9 | /** |
||
10 | * @var int |
||
11 | */ |
||
12 | private $downloads; |
||
13 | |||
14 | /** |
||
15 | * @var DateTimeImmutable |
||
16 | */ |
||
17 | private $startDate; |
||
18 | |||
19 | /** |
||
20 | * @var DateTimeImmutable |
||
21 | */ |
||
22 | private $endDate; |
||
23 | |||
24 | /** |
||
25 | * @param Package $package |
||
26 | * @param int $downloads |
||
27 | * @param DateTimeImmutable $startDate |
||
28 | * @param DateTimeImmutable $endDate |
||
29 | |||
30 | */ |
||
31 | public function __construct( |
||
32 | Package $package, |
||
33 | int $downloads, |
||
34 | DateTimeImmutable $startDate, |
||
35 | DateTimeImmutable $endDate |
||
36 | ) { |
||
37 | parent::__construct($package); |
||
38 | $this->downloads = $downloads; |
||
39 | $this->startDate = $startDate; |
||
40 | $this->endDate = $endDate; |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * @return string |
||
45 | */ |
||
46 | public function __toString() |
||
47 | { |
||
48 | return (string)$this->downloads; |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * @return int |
||
53 | */ |
||
54 | public function getDownloads(): int |
||
55 | { |
||
56 | return $this->downloads; |
||
57 | } |
||
58 | |||
59 | /** |
||
60 | * @return DateTimeImmutable |
||
61 | */ |
||
62 | public function getStartDate() |
||
65 | } |
||
66 | |||
67 | /** |
||
68 | * @return DateTimeImmutable |
||
69 | */ |
||
70 | public function getEndDate() |
||
73 | } |
||
74 | } |