| Total Complexity | 8 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | class Customers extends AbstractCollection |
||
| 19 | { |
||
| 20 | 19 | protected function createItemFromStdClass(stdClass $content): object |
|
| 21 | { |
||
| 22 | 19 | return new Customer($content); |
|
| 23 | } |
||
| 24 | |||
| 25 | 12 | public function getByRfc(string $rfc): Customer |
|
| 26 | { |
||
| 27 | 12 | $customer = $this->findByRfc($rfc); |
|
| 28 | 12 | if (null === $customer) { |
|
| 29 | 1 | throw new LogicException(sprintf('There is no customer with RFC %s', $rfc)); |
|
| 30 | } |
||
| 31 | 11 | return $customer; |
|
| 32 | } |
||
| 33 | |||
| 34 | 18 | public function findByRfc(string $rfc): ?Customer |
|
| 42 | } |
||
| 43 | |||
| 44 | 2 | public function merge(self $customers): self |
|
| 53 |