Code Duplication    Length = 10-11 lines in 6 locations

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

@@ 181-191 (lines=11) @@
178
     * @return \stdClass
179
     * @throws TwitchException
180
     */
181
    public function userFollowChannel($user, $channel, $userToken, $notifications = false)
182
    {
183
        $queryString = $this->helper->buildQueryString(array(
184
            'oauth_token' => $userToken,
185
            'notifications' => $notifications,
186
        ));
187
188
        $follow = new Methods\Follow($this->request);
189
190
        return $follow->followChannel($user, $channel, $queryString);
191
    }
192
193
    /**
194
     * Set user to unfollow given channel
@@ 202-211 (lines=10) @@
199
     * @return \stdClass
200
     * @throws TwitchException
201
     */
202
    public function userUnfollowChannel($user, $channel, $userToken)
203
    {
204
        $queryString = $this->helper->buildQueryString(array(
205
            'oauth_token' => $userToken,
206
        ));
207
208
        $follow = new Methods\Follow($this->request);
209
210
        return $follow->unfollowChannel($user, $channel, $queryString);
211
    }
212
213
    /**
214
     * Get the specified channel
@@ 259-269 (lines=11) @@
256
     * @return \stdClass
257
     * @throws TwitchException
258
     */
259
    public function teamList($limit = null, $offset = null)
260
    {
261
        $queryString = $this->helper->buildQueryString(array(
262
            'limit' => $limit,
263
            'offset' => $offset,
264
        ));
265
266
        $team = new Methods\Team($this->request);
267
268
        return $team->getTeams($queryString);
269
    }
270
271
    /**
272
     * Get all team members
@@ 328-337 (lines=10) @@
325
     * @throws TwitchException
326
     * @deprecated will be replaced by getStreams() function
327
     */
328
    public function streamSearch($query, $limit = null, $offset = null)
329
    {
330
        $queryString = $this->helper->buildQueryString(array(
331
            'query' => $query,
332
            'limit' => $limit,
333
            'offset' => $offset,
334
        ));
335
336
        return $this->request->request(self::URI_STREAMS_SEARCH . $queryString);
337
    }
338
339
    /**
340
     * Summarize streams
@@ 508-517 (lines=10) @@
505
     * @return \stdClass
506
     * @throws TwitchException
507
     */
508
    public function chatEmoticonsImages($emoteset = null)
509
    {
510
        $queryString = $this->helper->buildQueryString(array(
511
            'emotesets' => $emoteset,
512
        ));
513
514
        $chat = new Methods\Chat($this->request);
515
516
        return $chat->getEmoticonImages($queryString);
517
    }
518
519
    /**
520
     * Returns a list of chat badges
@@ 539-549 (lines=11) @@
536
     * @return \stdClass
537
     * @throws TwitchException
538
     */
539
    public function gamesTop($limit = null, $offset = null)
540
    {
541
        $queryString = $this->helper->buildQueryString(array(
542
            'limit' => $limit,
543
            'offset' => $offset,
544
        ));
545
546
        $game = new Methods\Game($this->request);
547
548
        return $game->getTop($queryString);
549
    }
550
551
    /**
552
     * Get HTML code for stream embedding