| Total Complexity | 9 |
| Total Lines | 83 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | class BeatMapMetadata |
||
| 6 | { |
||
| 7 | private object $metadata; |
||
| 8 | |||
| 9 | /** |
||
| 10 | * Create a new BeatMapMetadata object |
||
| 11 | * @param object $metadata |
||
| 12 | */ |
||
| 13 | public function __construct(object $metadata) |
||
| 16 | } |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Return raw data |
||
| 20 | * @return object |
||
| 21 | */ |
||
| 22 | public function toJson(): object |
||
| 23 | { |
||
| 24 | return $this->metadata; |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Return array data |
||
| 29 | * @return array |
||
| 30 | */ |
||
| 31 | public function toArray(): array |
||
| 32 | { |
||
| 33 | return json_decode(json_encode($this->metadata), true); |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Get metadata bpm |
||
| 38 | * @return int |
||
| 39 | */ |
||
| 40 | public function getBpm(): int |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Get metadata duration (in seconds) |
||
| 47 | * @return int |
||
| 48 | */ |
||
| 49 | public function getDuration(): int |
||
| 50 | { |
||
| 51 | return $this->metadata->duration; |
||
| 52 | } |
||
| 53 | |||
| 54 | /** |
||
| 55 | * Get metadata song name |
||
| 56 | * @return string |
||
| 57 | */ |
||
| 58 | public function getSongName(): string |
||
| 59 | { |
||
| 60 | return $this->metadata->songName; |
||
| 61 | } |
||
| 62 | |||
| 63 | /** |
||
| 64 | * Get metadata song sub name |
||
| 65 | * @return string |
||
| 66 | */ |
||
| 67 | public function getSongSubName(): string |
||
| 70 | } |
||
| 71 | |||
| 72 | /** |
||
| 73 | * Get metadata song author name |
||
| 74 | * @return string |
||
| 75 | */ |
||
| 76 | public function getSongAuthorName(): string |
||
| 79 | } |
||
| 80 | |||
| 81 | /** |
||
| 82 | * Get metadata level author name |
||
| 83 | * @return string |
||
| 84 | */ |
||
| 85 | public function getLeverAuthorName(): string |
||
| 88 | } |
||
| 89 | } |