| Conditions | 4 |
| Paths | 4 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 9 | public function __invoke($product, $formId) |
||
| 10 | { |
||
| 11 | if ($product->has('uoms') && count($product->getUoms()) > 1) { |
||
| 12 | $this->uomSelection(); |
||
| 13 | } |
||
| 14 | if ($product->getProductTypeId() == 1) { |
||
| 15 | $this->uomSelection(); |
||
| 16 | $this->builders($product->getBuilders(), $formId); |
||
| 17 | } |
||
| 18 | return; |
||
| 19 | } |
||
| 20 | |||
| 46 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: