| Conditions | 1 |
| Paths | 1 |
| Total Lines | 14 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 32 | 1 | public function jsonSerialize(): array |
|
| 33 | { |
||
| 34 | 1 | $artist = $this->album->getArtist(); |
|
| 35 | 1 | $albumId = $this->album->getId(); |
|
| 36 | |||
| 37 | 1 | $baseUrl = $this->config->getBaseUrl(); |
|
| 38 | |||
| 39 | return [ |
||
| 40 | 1 | 'id' => $albumId, |
|
| 41 | 1 | 'artistId' => $artist->getId(), |
|
| 42 | 1 | 'artistName' => (string) $artist->getTitle(), |
|
| 43 | 1 | 'name' => (string) $this->album->getTitle(), |
|
| 44 | 1 | 'cover' => sprintf('%s/art/album/%d', $baseUrl, $albumId), |
|
| 45 | 1 | 'length' => $this->album->getLength(), |
|
| 46 | ]; |
||
| 49 |