Completed
Push — master ( ca2c75...b8437a )
by Travis
02:25
created

GameDetails::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
rs 9.6666
cc 2
eloc 6
nc 2
nop 1
1
<?php
2
3
namespace Syntax\SteamApi\Containers;
4
5
class GameDetails extends BaseContainer
6
{
7
    public $gameId;
8
9
    public $serverIp;
10
11
    public $serverSteamId;
12
13
    public $extraInfo;
14
15
    public function __construct($gameDetails)
16
    {
17
        $gameId = $this->checkIssetField($gameDetails, 'gameid');
18
19
        $this->serverIp      = $this->checkIssetField($gameDetails, 'gameserverip');
20
        $this->serverSteamId = $this->checkIssetField($gameDetails, 'gameserversteamid');
21
        $this->extraInfo     = $this->checkIssetField($gameDetails, 'gameextrainfo');
22
        $this->gameId        = is_null($gameId) ? null : (int)$gameId;
23
    }
24
}
25