| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3.0123 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 48 | 1 | public function getArtistInformation(Artist $artist): ?array |
|
| 49 | { |
||
| 50 | 1 | if ($artist->is_unknown) { |
|
| 51 | return null; |
||
| 52 | } |
||
| 53 | |||
| 54 | 1 | $info = $this->lastfmService->getArtistInformation($artist->name); |
|
| 55 | |||
| 56 | 1 | if ($info) { |
|
| 57 | 1 | event(new ArtistInformationFetched($artist, $info)); |
|
| 58 | |||
| 59 | // The artist may have been updated. |
||
| 60 | 1 | $artist->refresh(); |
|
| 61 | 1 | $info['image'] = $artist->image; |
|
| 62 | } |
||
| 63 | |||
| 64 | 1 | return $info; |
|
| 65 | } |
||
| 67 |