Completed
Pull Request — master (#110)
by
unknown
01:32
created

Achievement::__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 8
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 Achievement
6
{
7
    public $apiName;
8
9
    public $achieved;
10
11
    public $name;
12
13
    public $description;
14
15
    public $icon;
16
17
    public $iconGray;
18
19
    public $unlockTimestamp;
20
21
    public function __construct($achievement)
22
    {
23
        $this->apiName         = (string) $achievement->apiname;
24
        $this->achieved        = (int)(string) $achievement['closed'];
25
        $this->name            = (string) $achievement->name;
26
        $this->description     = (string) $achievement->description;
27
        $this->icon            = (string) $achievement->iconClosed;
28
        $this->iconGray        = (string) $achievement->iconOpen;
29
        $this->unlockTimestamp = isset($achievement->unlockTimestamp) ? (int)(string) $achievement->unlockTimestamp : null;
30
    }
31
}
32