Total Complexity | 10 |
Total Lines | 56 |
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 | 9 | public function __construct(stdClass $raw) |
|
30 | 9 | } |
|
31 | |||
32 | 9 | private function get(string $keyword): string |
|
33 | { |
||
34 | 9 | return strval($this->data->{$keyword} ?? ''); |
|
35 | } |
||
36 | |||
37 | 2 | public function status(): CustomerStatus |
|
38 | { |
||
39 | 2 | return $this->status; |
|
40 | } |
||
41 | |||
42 | 1 | public function counter(): int |
|
43 | { |
||
44 | 1 | return intval($this->get('counter')); |
|
45 | } |
||
46 | |||
47 | 4 | public function rfc(): string |
|
50 | } |
||
51 | |||
52 | 9 | public function credit(): int |
|
53 | { |
||
54 | 9 | return intval($this->get('credit')); |
|
55 | } |
||
56 | |||
57 | 1 | public function customerType(): CustomerType |
|
60 | } |
||
61 | |||
62 | 2 | public function values(): array |
|
63 | { |
||
67 |