| Total Complexity | 9 |
| Total Lines | 84 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | class BeatMapUploader |
||
| 6 | { |
||
| 7 | private object $uploader; |
||
| 8 | |||
| 9 | /** |
||
| 10 | * Create a new BeatMapUploader object |
||
| 11 | * @param object $uploader |
||
| 12 | */ |
||
| 13 | public function __construct(object $uploader) |
||
| 16 | } |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Return raw data |
||
| 20 | * @return object |
||
| 21 | */ |
||
| 22 | public function toJson(): object |
||
| 23 | { |
||
| 24 | return $this->uploader; |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Return array data |
||
| 29 | * @return array |
||
| 30 | */ |
||
| 31 | public function toArray(): array |
||
| 32 | { |
||
| 33 | return json_decode($this->uploader, true); |
||
|
|
|||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Get uploader ID |
||
| 38 | * @return int |
||
| 39 | */ |
||
| 40 | public function getId(): int |
||
| 41 | { |
||
| 42 | return $this->uploader->id; |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Get uploader name |
||
| 47 | * @return string |
||
| 48 | */ |
||
| 49 | public function getName(): string |
||
| 52 | } |
||
| 53 | |||
| 54 | /** |
||
| 55 | * Get uploader hash |
||
| 56 | * @return string |
||
| 57 | */ |
||
| 58 | public function getHash(): string |
||
| 61 | } |
||
| 62 | |||
| 63 | /** |
||
| 64 | * Get uploader avatar link |
||
| 65 | * @return string |
||
| 66 | */ |
||
| 67 | public function getAvatarURL(): string |
||
| 68 | { |
||
| 69 | return $this->uploader->avatar; |
||
| 70 | } |
||
| 71 | |||
| 72 | /** |
||
| 73 | * Get uploader type |
||
| 74 | * @return string |
||
| 75 | */ |
||
| 76 | public function getType(): string |
||
| 77 | { |
||
| 78 | return $this->uploader->type; |
||
| 79 | } |
||
| 80 | |||
| 81 | |||
| 82 | /** |
||
| 83 | * Is uploader unique set ? |
||
| 84 | * @return bool |
||
| 85 | */ |
||
| 86 | public function isUniqueSet(): bool |
||
| 89 | } |
||
| 90 | } |