Total Complexity | 8 |
Total Lines | 74 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | class BeatMapStats |
||
6 | { |
||
7 | private object $stats; |
||
8 | |||
9 | /** |
||
10 | * Create a new BeatMapStats object |
||
11 | * @param object $stats |
||
12 | */ |
||
13 | public function __construct(object $stats) |
||
16 | } |
||
17 | |||
18 | /** |
||
19 | * Return raw data |
||
20 | * @return object |
||
21 | */ |
||
22 | public function toJson(): object |
||
23 | { |
||
24 | return $this->stats; |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * Return array data |
||
29 | * @return array |
||
30 | */ |
||
31 | public function toArray(): array |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * Get map plays number |
||
38 | * @return int |
||
39 | */ |
||
40 | public function getPlaysNumber(): int |
||
41 | { |
||
42 | return $this->stats->plays; |
||
43 | } |
||
44 | |||
45 | /** |
||
46 | * Get map download number |
||
47 | * @return int |
||
48 | */ |
||
49 | public function getDownloadsNumber(): int |
||
50 | { |
||
51 | return $this->stats->downloads; |
||
52 | } |
||
53 | |||
54 | /** |
||
55 | * Get map upvotes number |
||
56 | * @return int |
||
57 | */ |
||
58 | public function getUpvotesNumber(): int |
||
61 | } |
||
62 | |||
63 | /** |
||
64 | * Get map downvotes number |
||
65 | * @return int |
||
66 | */ |
||
67 | public function getDownvotesNumber(): int |
||
68 | { |
||
69 | return $this->stats->downvotes; |
||
70 | } |
||
71 | |||
72 | /** |
||
73 | * Get votes ratio |
||
74 | * @return int |
||
75 | */ |
||
76 | public function getVotesRatio(): float |
||
79 | } |
||
80 | } |