| 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 | 22 | public function __construct(stdClass $raw) |
|
| 21 | { |
||
| 22 | 22 | $this->data = $raw; |
|
| 23 | 22 | $rawStatus = $this->get('status'); |
|
| 24 | 22 | if (in_array($rawStatus, CustomerStatus::toArray())) { |
|
| 25 | 20 | $this->status = new CustomerStatus($rawStatus); |
|
| 26 | } else { |
||
| 27 | 2 | $this->status = CustomerStatus::suspended(); |
|
| 28 | } |
||
| 29 | 22 | $this->type = (-1 === $this->credit()) ? CustomerType::ondemand() : CustomerType::prepaid(); |
|
| 30 | } |
||
| 68 |