Code Duplication    Length = 12-16 lines in 5 locations

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

@@ 143-155 (lines=13) @@
140
     * @return \stdClass
141
     * @throws TwitchException
142
     */
143
    public function userFollowChannels($user, $limit = null, $offset = null, $direction = null, $sortby = null)
144
    {
145
        $queryString = $this->helper->buildQueryString(array(
146
            'limit' => $limit,
147
            'offset' => $offset,
148
            'direction' => $direction,
149
            'sortby' => $sortby,
150
        ));
151
152
        $follow = new Methods\Follow($this->request);
153
154
        return $follow->userFollowChannels($user, $queryString);
155
    }
156
157
    /**
158
     * Get the status of a follow relationship
@@ 292-304 (lines=13) @@
289
     * @return \stdClass
290
     * @throws TwitchException
291
     */
292
    public function channelFollows($channelName, $limit = null, $offset = null, $cursor = null, $direction = null)
293
    {
294
        $queryString = $this->helper->buildQueryString(array(
295
            'limit' => $limit,
296
            'offset' => $offset,
297
            'cursor' => $cursor,
298
            'direction' => $direction,
299
        ));
300
301
        $follow = new Methods\Follow($this->request);
302
303
        return $follow->getChannelFollows($channelName, $queryString);
304
    }
305
306
    /**
307
     * Get the specified channel's stream
@@ 347-362 (lines=16) @@
344
     * @return \stdClass
345
     * @throws TwitchException
346
     */
347
    public function streamsSummarize($game = null, array $channels = null, $hls = null)
348
    {
349
        if (!empty($channels)) {
350
            $channels = implode(',', $channels);
351
        }
352
353
        $queryString = $this->helper->buildQueryString(array(
354
            'game' => $game,
355
            'channel' => $channels,
356
            'hls' => $hls,
357
        ));
358
359
        $stream = new Methods\Stream($this->request);
360
361
        return $stream->getSummary($queryString);
362
    }
363
364
    /**
365
     * Get featured streams
@@ 372-383 (lines=12) @@
369
     * @return \stdClass
370
     * @throws TwitchException
371
     */
372
    public function streamsFeatured($limit = null, $offset = null, $hls = null)
373
    {
374
        $queryString = $this->helper->buildQueryString(array(
375
            'limit' => $limit,
376
            'offset' => $offset,
377
            'hls' => $hls,
378
        ));
379
380
        $stream = new Methods\Stream($this->request);
381
382
        return $stream->getFeatured($queryString);
383
    }
384
385
    /**
386
     * Get streams by channel
@@ 463-475 (lines=13) @@
460
     * @return \stdClass
461
     * @throws TwitchException
462
     */
463
    public function videosByChannel($channel, $limit = null, $offset = null, $broadcasts = null, $hls = null)
464
    {
465
        $queryString = $this->helper->buildQueryString(array(
466
            'limit' => $limit,
467
            'offset' => $offset,
468
            'broadcasts' => $broadcasts,
469
            'hls' => $hls,
470
        ));
471
472
        $video = new Methods\Video($this->request);
473
474
        return $video->getChannelVideos($channel, $queryString);
475
    }
476
477
    /**
478
     * Returns a links object to all other chat endpoints