Code Duplication    Length = 18-19 lines in 2 locations

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

@@ 518-536 (lines=19) @@
515
     * @throws InvalidParameterException
516
     * @throws NotFoundException
517
     */
518
    public function startSnoop($channelId, $spy, $whisper, $app, $appArgs, $snoopId)
519
    {
520
        $uri = "channels/$channelId/snoop";
521
        try {
522
            $response = $this->client->getEndpoint()->post($uri, [
523
                'form_params' => [
524
                    'spy' => $spy,
525
                    'whisper' => $whisper,
526
                    'app' => $app,
527
                    'appArgs' => $appArgs,
528
                    'snoopId' => $snoopId,
529
                ]
530
            ]);
531
        } catch (RequestException $e) {
532
            $this->processRequestException($e);
533
        }
534
535
        return new Channel($this->client, \GuzzleHttp\json_decode($response->getBody()));
536
    }
537
538
    /**
539
     * Start snooping. Snoop (spy/whisper) on a specific channel.
@@ 551-568 (lines=18) @@
548
     * @throws InvalidParameterException
549
     * @throws NotFoundException
550
     */
551
    public function startSnoopWithId($channelId, $spy, $whisper, $app, $appArgs, $snoopId)
552
    {
553
        $uri = "channels/$channelId/snoop/$snoopId";
554
        try {
555
            $response = $this->client->getEndpoint()->post($uri, [
556
                'form_params' => [
557
                    'spy' => $spy,
558
                    'whisper' => $whisper,
559
                    'app' => $app,
560
                    'appArgs' => $appArgs,
561
                ]
562
            ]);
563
        } catch (RequestException $e) {
564
            $this->processRequestException($e);
565
        }
566
567
        return new Channel($this->client, \GuzzleHttp\json_decode($response->getBody()));
568
    }
569
570
    /**
571
     * @return string