Code Duplication    Length = 18-19 lines in 2 locations

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

@@ 527-545 (lines=19) @@
524
     * @throws InvalidParameterException
525
     * @throws NotFoundException
526
     */
527
    public function startSnoop($channelId, $spy, $whisper, $app, $appArgs, $snoopId)
528
    {
529
        $uri = "channels/$channelId/snoop";
530
        try {
531
            $response = $this->client->getEndpoint()->post($uri, [
532
                'form_params' => [
533
                    'spy' => $spy,
534
                    'whisper' => $whisper,
535
                    'app' => $app,
536
                    'appArgs' => $appArgs,
537
                    'snoopId' => $snoopId,
538
                ]
539
            ]);
540
        } catch (RequestException $e) {
541
            $this->processRequestException($e);
542
        }
543
544
        return new Channel($this->client, \GuzzleHttp\json_decode($response->getBody()));
545
    }
546
547
    /**
548
     * Start snooping. Snoop (spy/whisper) on a specific channel.
@@ 560-577 (lines=18) @@
557
     * @throws InvalidParameterException
558
     * @throws NotFoundException
559
     */
560
    public function startSnoopWithId($channelId, $spy, $whisper, $app, $appArgs, $snoopId)
561
    {
562
        $uri = "channels/$channelId/snoop/$snoopId";
563
        try {
564
            $response = $this->client->getEndpoint()->post($uri, [
565
                'form_params' => [
566
                    'spy' => $spy,
567
                    'whisper' => $whisper,
568
                    'app' => $app,
569
                    'appArgs' => $appArgs,
570
                ]
571
            ]);
572
        } catch (RequestException $e) {
573
            $this->processRequestException($e);
574
        }
575
576
        return new Channel($this->client, \GuzzleHttp\json_decode($response->getBody()));
577
    }
578
579
    /**
580
     * @return string