Completed
Push — develop ( 6f2df9...3563b6 )
by Josef
01:50
created

Game   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 2
c 3
b 0
f 0
lcom 1
cbo 1
dl 0
loc 28
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getTop() 0 4 1
1
<?php
2
3
namespace ritero\SDK\TwitchTV\Methods;
4
5
use ritero\SDK\TwitchTV\TwitchRequest;
6
use ritero\SDK\TwitchTV\TwitchException;
7
8
/**
9
 * TwitchTV API SDK for PHP
10
 *
11
 * Games method class
12
 *
13
 * @author Josef Ohnheiser <[email protected]>
14
 * @license https://github.com/jofner/Twitch-SDK/blob/master/LICENSE.md MIT
15
 * @homepage https://github.com/jofner/Twitch-SDK
16
 */
17
class Game
18
{
19
    /** @var TwitchRequest */
20
    protected $request;
21
22
    const URI_GAMES_TOP = 'games/top/';
23
24
    /**
25
     * Game constructor
26
     * @param TwitchRequest $request
27
     */
28
    public function __construct(TwitchRequest $request)
29
    {
30
        $this->request = $request;
31
    }
32
33
    /**
34
     * Get top games
35
     * @see https://github.com/justintv/Twitch-API/blob/master/v3_resources/games.md#get-gamestop
36
     * @param string $queryString
37
     * @return \stdClass
38
     * @throws TwitchException
39
     */
40
    public function getTop($queryString)
41
    {
42
        return $this->request->request(self::URI_GAMES_TOP . $queryString);
43
    }
44
}
45