Code Duplication    Length = 12-13 lines in 6 locations

src/ritero/SDK/TwitchTV/TwitchSDK.php 6 locations

@@ 680-691 (lines=12) @@
677
     * @return \stdClass
678
     * @throws TwitchException
679
     */
680
    public function authUserGet($token)
681
    {
682
        $this->checkConfig();
683
684
        $queryString = $this->helper->buildQueryString(array(
685
            'oauth_token' => $token,
686
            'client_id' => $this->getConfigParam('client_id'),
687
        ));
688
689
        $user = new Methods\User($this->request);
690
        return $user->getUserAuth($queryString);
691
    }
692
693
    /**
694
     * Get the authenticated channel
@@ 700-712 (lines=13) @@
697
     * @return \stdClass
698
     * @throws TwitchException
699
     */
700
    public function authChannelGet($token)
701
    {
702
        $this->checkConfig();
703
704
        $queryString = $this->helper->buildQueryString(array(
705
            'oauth_token' => $token,
706
            'client_id' => $this->getConfigParam('client_id'),
707
        ));
708
709
        $channels = new Methods\Channel($this->request);
710
711
        return $channels->getChannel($queryString);
712
    }
713
714
    /**
715
     * Update channel's status or game
@@ 753-765 (lines=13) @@
750
     * @return \stdClass
751
     * @throws TwitchException
752
     */
753
    public function authChannelResetKey($token, $channelName)
754
    {
755
        $this->checkConfig();
756
757
        $queryString = $this->helper->buildQueryString(array(
758
            'oauth_token' => $token,
759
            'client_id' => $this->getConfigParam('client_id'),
760
        ));
761
762
        $channel = new Methods\Channel($this->request);
763
764
        return $channel->resetStreamKey($channelName, $queryString);
765
    }
766
767
    /**
768
     * Returns an array of users who are editors of specified channel
@@ 775-787 (lines=13) @@
772
     * @return \stdClass
773
     * @throws TwitchException
774
     */
775
    public function authChannelEditors($token, $channel)
776
    {
777
        $this->checkConfig();
778
779
        $queryString = $this->helper->buildQueryString(array(
780
            'oauth_token' => $token,
781
            'client_id' => $this->getConfigParam('client_id'),
782
        ));
783
784
        $channels = new Methods\Channel($this->request);
785
786
        return $channels->getEditors($channel, $queryString);
787
    }
788
789
    /**
790
     * Returns an array of subscriptions who are subscribed to specified channel
@@ 826-838 (lines=13) @@
823
     * @return \stdClass
824
     * @throws TwitchException
825
     */
826
    public function authSubscribedUser($token, $channel, $user)
827
    {
828
        $this->checkConfig();
829
830
        $queryString = $this->helper->buildQueryString(array(
831
            'oauth_token' => $token,
832
            'client_id' => $this->getConfigParam('client_id'),
833
        ));
834
835
        $subscription = new Methods\Subscription($this->request);
836
837
        return $subscription->getSubscribedUser($channel, $user, $queryString);
838
    }
839
840
    /**
841
     * Returns a channel object that user subscribes to
@@ 849-861 (lines=13) @@
846
     * @return \stdClass
847
     * @throws TwitchException
848
     */
849
    public function authSubscribedToChannel($token, $user, $channel)
850
    {
851
        $this->checkConfig();
852
853
        $queryString = $this->helper->buildQueryString(array(
854
            'oauth_token' => $token,
855
            'client_id' => $this->getConfigParam('client_id'),
856
        ));
857
858
        $subscription = new Methods\Subscription($this->request);
859
860
        return $subscription->getSubscribedToChannel($user, $channel, $queryString);
861
    }
862
863
    /**
864
     * List the live streams that the authenticated user is following