Game::getTop()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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