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