Total Complexity | 6 |
Total Lines | 25 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | class Customers extends AbstractCollection |
||
12 | { |
||
13 | 6 | protected function createItemFromStdClass(stdClass $content): object |
|
14 | { |
||
15 | 6 | return new Customer($content); |
|
16 | } |
||
17 | |||
18 | 2 | public function getByRfc(string $rfc): Customer |
|
19 | { |
||
20 | 2 | $customer = $this->findByRfc($rfc); |
|
|
|||
21 | 2 | if (null === $customer) { |
|
22 | 1 | throw new LogicException(sprintf('There is no customer with RFC %s', $rfc)); |
|
23 | } |
||
24 | 1 | return $customer; |
|
25 | } |
||
26 | |||
27 | 3 | public function findByRfc(string $rfc): ?Customer |
|
36 | } |
||
37 | } |
||
38 |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()
can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.