| Total Complexity | 6 |
| Total Lines | 56 |
| 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) |
||
| 14 | { |
||
| 15 | $this->stats = $stats; |
||
| 16 | } |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Get map plays number |
||
| 20 | * @return int |
||
| 21 | */ |
||
| 22 | public function getPlaysNumber(): int |
||
| 23 | { |
||
| 24 | return $this->stats->plays; |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Get map download number |
||
| 29 | * @return int |
||
| 30 | */ |
||
| 31 | public function getDownloadsNumber(): int |
||
| 32 | { |
||
| 33 | return $this->stats->downloads; |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Get map upvotes number |
||
| 38 | * @return int |
||
| 39 | */ |
||
| 40 | public function getUpvotesNumber(): int |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Get map downvotes number |
||
| 47 | * @return int |
||
| 48 | */ |
||
| 49 | public function getDownvotesNumber(): int |
||
| 50 | { |
||
| 51 | return $this->stats->downvotes; |
||
| 52 | } |
||
| 53 | |||
| 54 | /** |
||
| 55 | * Get votes ratio |
||
| 56 | * @return int |
||
| 57 | */ |
||
| 58 | public function getVotesRatio(): float |
||
| 61 | } |
||
| 62 | } |