Conditions | 3 |
Paths | 4 |
Total Lines | 10 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | 9 | public function __construct(stdClass $raw) |
|
21 | { |
||
22 | 9 | $this->data = $raw; |
|
23 | 9 | $rawStatus = strval($this->get('status')); |
|
24 | 9 | if (in_array($rawStatus, CustomerStatus::toArray())) { |
|
25 | 7 | $this->status = new CustomerStatus($rawStatus); |
|
26 | } else { |
||
27 | 2 | $this->status = CustomerStatus::suspended(); |
|
28 | } |
||
29 | 9 | $this->type = (-1 === $this->credit()) ? CustomerType::ondemand() : CustomerType::prepaid(); |
|
30 | 9 | } |
|
67 |