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

GameDetails   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 23
ccs 0
cts 9
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 2
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