Completed
Push — master ( 99fa2d...6291ae )
by Ezra
02:24
created

GameDetails::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 0
cts 9
cp 0
rs 9.9332
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 6
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 $lobbyId;
14
15
    public $extraInfo;
16
17
    public function __construct($gameDetails)
18
    {
19
        $gameId = $this->checkIssetField($gameDetails, 'gameid');
20
21
        $this->serverIp      = $this->checkIssetField($gameDetails, 'gameserverip');
22
        $this->serverSteamId = $this->checkIssetField($gameDetails, 'gameserversteamid');
23
        $this->extraInfo     = $this->checkIssetField($gameDetails, 'gameextrainfo');
24
        $this->lobbyId       = $this->checkIssetField($gameDetails, 'lobbysteamid');
25
        $this->gameId        = is_null($gameId) ? null : (int)$gameId;
26
    }
27
}
28