Conditions | 4 |
Paths | 2 |
Total Lines | 27 |
Code Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
7 | public function listTopGames($args = array()) |
||
8 | { |
||
9 | $response = $this->call('listTopGames', $args); |
||
10 | |||
11 | $games = []; |
||
12 | |||
13 | if (is_object($response) === true && isset($response->top) === true) |
||
14 | { |
||
15 | foreach($response->top as $topgame) { |
||
16 | $game = new Game(); |
||
17 | $game->setName($topgame->game->name); |
||
18 | $game->setViewers($topgame->viewers); |
||
19 | $game->setChannels($topgame->channels); |
||
20 | $game->setBoxLarge($topgame->game->box->large); |
||
21 | $game->setBoxMedium($topgame->game->box->medium); |
||
22 | $game->setBoxSmall($topgame->game->box->small); |
||
23 | $game->setBoxTemplate($topgame->game->box->template); |
||
24 | $game->setLogoLarge($topgame->game->logo->large); |
||
25 | $game->setLogoMedium($topgame->game->logo->medium); |
||
26 | $game->setLogoSmall($topgame->game->logo->small); |
||
27 | $game->setLogoTemplate($topgame->game->logo->template); |
||
28 | $games[] = $game; |
||
29 | } |
||
30 | } |
||
31 | |||
32 | return $games; |
||
33 | } |
||
34 | } |