Conditions | 1 |
Paths | 1 |
Total Lines | 23 |
Lines | 0 |
Ratio | 0 % |
Tests | 19 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
33 | 1 | public function __construct($item) |
|
34 | { |
||
35 | 1 | $this->id = $item->id; |
|
36 | 1 | $this->originalId = $item->original_id; |
|
37 | 1 | $this->defIndex = $item->defindex; |
|
38 | 1 | $this->level = $item->level; |
|
39 | 1 | $this->quality = $item->quality; |
|
40 | 1 | $this->quantity = $item->quantity; |
|
41 | 1 | $this->inventory = $item->inventory; |
|
42 | 1 | $this->origin = $this->checkIssetField($item, 'origin'); |
|
43 | 1 | $this->containedItem = $this->checkIssetField($item, 'contained_item'); |
|
44 | 1 | $this->style = $this->checkIssetField($item, 'style'); |
|
45 | 1 | $this->attributes = $this->checkIssetField($item, 'attributes'); |
|
46 | |||
47 | 1 | $this->flags = [ |
|
48 | 1 | 'trade' => (boolean)! $this->checkIssetField($item, 'flag_cannot_trade', false), |
|
49 | 1 | 'craft' => (boolean)! $this->checkIssetField($item, 'flag_cannot_craft', false), |
|
50 | ]; |
||
51 | 1 | $this->custom = [ |
|
52 | 1 | 'name' => $this->checkIssetField($item, 'custom_name'), |
|
53 | 1 | 'description' => $this->checkIssetField($item, 'custom_desc'), |
|
54 | ]; |
||
55 | 1 | } |
|
56 | } |
||
57 |