Code Duplication    Length = 18-19 lines in 2 locations

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

@@ 589-607 (lines=19) @@
586
     * @throws InvalidParameterException
587
     * @throws NotFoundException
588
     */
589
    public function startSnoop($channelId, $spy, $whisper, $app, $appArgs, $snoopId)
590
    {
591
        $uri = "channels/$channelId/snoop";
592
        try {
593
            $response = $this->client->getEndpoint()->post($uri, [
594
                'form_params' => [
595
                    'spy' => $spy,
596
                    'whisper' => $whisper,
597
                    'app' => $app,
598
                    'appArgs' => $appArgs,
599
                    'snoopId' => $snoopId,
600
                ]
601
            ]);
602
        } catch (RequestException $e) {
603
            $this->processRequestException($e);
604
        }
605
606
        return new Channel($this->client, \GuzzleHttp\json_decode($response->getBody()));
607
    }
608
609
    /**
610
     * Start snooping. Snoop (spy/whisper) on a specific channel.
@@ 622-639 (lines=18) @@
619
     * @throws InvalidParameterException
620
     * @throws NotFoundException
621
     */
622
    public function startSnoopWithId($channelId, $spy, $whisper, $app, $appArgs, $snoopId)
623
    {
624
        $uri = "channels/$channelId/snoop/$snoopId";
625
        try {
626
            $response = $this->client->getEndpoint()->post($uri, [
627
                'form_params' => [
628
                    'spy' => $spy,
629
                    'whisper' => $whisper,
630
                    'app' => $app,
631
                    'appArgs' => $appArgs,
632
                ]
633
            ]);
634
        } catch (RequestException $e) {
635
            $this->processRequestException($e);
636
        }
637
638
        return new Channel($this->client, \GuzzleHttp\json_decode($response->getBody()));
639
    }
640
641
    /**
642
     * @return string