| Conditions | 4 |
| Paths | 5 |
| Total Lines | 19 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 14 | public function create(array $options = []): AddressInterface |
||
| 15 | { |
||
| 16 | $options = $this->optionsResolver->resolve($options); |
||
| 17 | |||
| 18 | $address = parent::create($options); |
||
| 19 | |||
| 20 | if (!$address instanceof VatNumberAddressInterface) { |
||
| 21 | return $address; |
||
|
|
|||
| 22 | } |
||
| 23 | |||
| 24 | if (isset($options['vat_number'])) { |
||
| 25 | $address->setVatNumber($options['vat_number']); |
||
| 26 | } |
||
| 27 | |||
| 28 | if (isset($options['vat_valid'])) { |
||
| 29 | $address->setVatValid($options['vat_valid']); |
||
| 30 | } |
||
| 31 | |||
| 32 | return $address; |
||
| 33 | } |
||
| 49 |
In the issue above, the returned value is violating the contract defined by the mentioned interface.
Let's take a look at an example: