Code Duplication    Length = 18-19 lines in 2 locations

src/wormling/phparia/Api/Channels.php 2 locations

@@ 544-562 (lines=19) @@
541
     * @throws InvalidParameterException
542
     * @throws NotFoundException
543
     */
544
    public function startSnoop($channelId, $spy, $whisper, $app, $appArgs, $snoopId)
545
    {
546
        $uri = "/channels/$channelId/snoop";
547
        try {
548
            $response = $this->client->getEndpoint()->post($uri, array(
549
                'spy' => $spy,
550
                'whisper' => $whisper,
551
                'app' => $app,
552
                'appArgs' => $appArgs,
553
                'snoopId' => $snoopId,
554
            ));
555
        } catch (Pest_BadRequest $e) { // Missing parameters
556
            throw new InvalidParameterException($e);
557
        } catch (Pest_NotFound $e) { // Channel not found
558
            throw new NotFoundException($e);
559
        }
560
561
        return new Channel($this->client, $response);
562
    }
563
564
    /**
565
     * Start snooping. Snoop (spy/whisper) on a specific channel.
@@ 577-594 (lines=18) @@
574
     * @throws InvalidParameterException
575
     * @throws NotFoundException
576
     */
577
    public function startSnoopWithId($channelId, $spy, $whisper, $app, $appArgs, $snoopId)
578
    {
579
        $uri = "/channels/$channelId/snoop/$snoopId";
580
        try {
581
            $response = $this->client->getEndpoint()->post($uri, array(
582
                'spy' => $spy,
583
                'whisper' => $whisper,
584
                'app' => $app,
585
                'appArgs' => $appArgs,
586
            ));
587
        } catch (Pest_BadRequest $e) { // Missing parameters
588
            throw new InvalidParameterException($e);
589
        } catch (Pest_NotFound $e) { // Channel not found
590
            throw new NotFoundException($e);
591
        }
592
593
        return new Channel($this->client, $response);
594
    }
595
596
    /**
597
     * @return string