Total Complexity | 9 |
Total Lines | 83 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | class UserStatsDifficulties |
||
6 | { |
||
7 | private object $diff; |
||
8 | |||
9 | /** |
||
10 | * Create a new UserStatsDifficulties object |
||
11 | * @param object $diff |
||
12 | */ |
||
13 | public function __construct(object $diff) |
||
16 | } |
||
17 | |||
18 | /** |
||
19 | * Return raw data |
||
20 | * @return object |
||
21 | */ |
||
22 | public function toJson(): object |
||
23 | { |
||
24 | return $this->diff; |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * Return array data |
||
29 | * @return array |
||
30 | */ |
||
31 | public function toArray(): array |
||
32 | { |
||
33 | return json_decode($this->diff, true); |
||
|
|||
34 | } |
||
35 | |||
36 | /** |
||
37 | * Get user stats difficulties total |
||
38 | * @return int |
||
39 | */ |
||
40 | public function getTotal(): int |
||
41 | { |
||
42 | return $this->diff->total; |
||
43 | } |
||
44 | |||
45 | /** |
||
46 | * Get user stats difficulties easy number |
||
47 | * @return int |
||
48 | */ |
||
49 | public function getEasyNumber(): int |
||
50 | { |
||
51 | return $this->diff->easy; |
||
52 | } |
||
53 | |||
54 | /** |
||
55 | * Get user stats difficulties normal number |
||
56 | * @return int |
||
57 | */ |
||
58 | public function getNormalNumber(): int |
||
59 | { |
||
60 | return $this->diff->normal; |
||
61 | } |
||
62 | |||
63 | /** |
||
64 | * Get user stats difficulties hard number |
||
65 | * @return int |
||
66 | */ |
||
67 | public function getHardNumber(): int |
||
68 | { |
||
69 | return $this->diff->hard; |
||
70 | } |
||
71 | |||
72 | /** |
||
73 | * Get user stats difficulties expert number |
||
74 | * @return int |
||
75 | */ |
||
76 | public function getExpertNumber(): int |
||
79 | } |
||
80 | |||
81 | /** |
||
82 | * Get user stats difficulties expert+ number |
||
83 | * @return int |
||
84 | */ |
||
85 | public function getExpertPlusNumber(): int |
||
88 | } |
||
89 | } |