| Total Complexity | 10 |
| Total Lines | 57 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class Customer |
||
| 10 | { |
||
| 11 | /** @var stdClass */ |
||
| 12 | private $data; |
||
| 13 | |||
| 14 | /** @var CustomerStatus */ |
||
| 15 | private $status; |
||
| 16 | |||
| 17 | /** @var CustomerType */ |
||
| 18 | private $type; |
||
| 19 | |||
| 20 | 22 | public function __construct(stdClass $raw) |
|
| 30 | } |
||
| 31 | |||
| 32 | 22 | private function get(string $keyword): string |
|
| 33 | { |
||
| 34 | 22 | return strval($this->data->{$keyword} ?? ''); |
|
| 35 | } |
||
| 36 | |||
| 37 | 5 | public function status(): CustomerStatus |
|
| 38 | { |
||
| 39 | 5 | return $this->status; |
|
| 40 | } |
||
| 41 | |||
| 42 | 1 | public function counter(): int |
|
| 43 | { |
||
| 44 | 1 | return intval($this->get('counter')); |
|
| 45 | } |
||
| 46 | |||
| 47 | 15 | public function rfc(): string |
|
| 50 | } |
||
| 51 | |||
| 52 | 22 | public function credit(): int |
|
| 53 | { |
||
| 54 | 22 | return intval($this->get('credit')); |
|
| 55 | } |
||
| 56 | |||
| 57 | 7 | public function customerType(): CustomerType |
|
| 60 | } |
||
| 61 | |||
| 62 | /** @return array<mixed> */ |
||
| 63 | 2 | public function values(): array |
|
| 68 |