Code Duplication    Length = 8-22 lines in 4 locations

src/MusicBrainz/MusicBrainz.php 4 locations

@@ 397-404 (lines=8) @@
394
     * @return array
395
     * @throws Exception
396
     */
397
    public function browseArtist($entity, $mbid, array $includes = array(), $limit = 25, $offset = NULL)
398
    {
399
        if (!in_array($entity, array('recording', 'release', 'release-group'))) {
400
            throw new Exception('Invalid browse entity for artist');
401
        }
402
403
        return $this->browse(new Filters\ArtistFilter(array()), $entity, $mbid, $includes, $limit, $offset);
404
    }
405
406
    /**
407
     * @param       $entity
@@ 416-423 (lines=8) @@
413
     * @return array
414
     * @throws Exception
415
     */
416
    public function browseLabel($entity, $mbid, array $includes, $limit = 25, $offset = NULL)
417
    {
418
        if (!in_array($entity, array('release'))) {
419
            throw new Exception('Invalid browse entity for label');
420
        }
421
422
        return $this->browse(new Filters\LabelFilter(array()), $entity, $mbid, $includes, $limit, $offset);
423
    }
424
425
    /**
426
     * @param       $entity
@@ 435-442 (lines=8) @@
432
     * @return array
433
     * @throws Exception
434
     */
435
    public function browseRecording($entity, $mbid, array $includes = array(), $limit = 25, $offset = NULL)
436
    {
437
        if (!in_array($entity, array('artist', 'release'))) {
438
            throw new Exception('Invalid browse entity for recording');
439
        }
440
441
        return $this->browse(new Filters\RecordingFilter(array()), $entity, $mbid, $includes, $limit, $offset);
442
    }
443
444
    /**
445
     * @param       string $entity
@@ 492-513 (lines=22) @@
489
     * @return array
490
     * @throws Exception
491
     */
492
    public function browseReleaseGroup(
493
        $entity,
494
        $mbid,
495
        $limit = 25,
496
        $offset = NULL,
497
        array $includes,
498
        $releaseType = array()
499
    ) {
500
        if (!in_array($entity, array('artist', 'release'))) {
501
            throw new Exception('Invalid browse entity for release group');
502
        }
503
504
        return $this->browse(
505
            new Filters\ReleaseGroupFilter(array()),
506
            $entity,
507
            $mbid,
508
            $includes,
509
            $limit,
510
            $offset,
511
            $releaseType
512
        );
513
    }
514
515
    /**
516
     * Performs a query based on the parameters supplied in the Filter object.