Code Duplication    Length = 17-18 lines in 2 locations

app/Services/Lastfm.php 2 locations

@@ 226-243 (lines=18) @@
223
     *
224
     * @return bool
225
     */
226
    public function scrobble($artist, $track, $timestamp, $album, $sk)
227
    {
228
        $params = compact('artist', 'track', 'timestamp', 'sk');
229
230
        if ($album) {
231
            $params['album'] = $album;
232
        }
233
234
        $params['method'] = 'track.scrobble';
235
236
        try {
237
            return (bool) $this->post('/', $this->buildAuthCallParams($params), false);
238
        } catch (Exception $e) {
239
            Log::error($e);
240
241
            return false;
242
        }
243
    }
244
245
    /**
246
     * Love or unlove a track on Last.fm.
@@ 280-296 (lines=17) @@
277
     *
278
     * @return bool
279
     */
280
    public function updateNowPlaying($artist, $track, $album, $duration, $sk)
281
    {
282
        $params = compact('artist', 'track', 'duration', 'sk');
283
        $params['method'] = 'track.updateNowPlaying';
284
285
        if ($album) {
286
            $params['album'] = $album;
287
        }
288
289
        try {
290
            return (bool) $this->post('/', $this->buildAuthCallParams($params), false);
291
        } catch (Exception $e) {
292
            Log::error($e);
293
294
            return false;
295
        }
296
    }
297
298
    /**
299
     * Build the parameters to use for _authenticated_ Last.fm API calls.