| Conditions | 4 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4.016 |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | 1 | public function handle(SongLikeToggled $event): void |
|
| 18 | { |
||
| 19 | 1 | if (!$this->lastfm->enabled() || |
|
| 20 | 1 | !($sessionKey = $event->user->lastfm_session_key) || |
|
| 21 | 1 | $event->interaction->song->artist->is_unknown |
|
| 22 | ) { |
||
| 23 | return; |
||
| 24 | } |
||
| 25 | |||
| 26 | 1 | $this->lastfm->toggleLoveTrack( |
|
| 27 | 1 | $event->interaction->song->title, |
|
| 28 | 1 | $event->interaction->song->artist->name, |
|
| 29 | 1 | $sessionKey, |
|
| 30 | 1 | $event->interaction->liked |
|
| 31 | ); |
||
| 34 |