Total Complexity | 5 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | final class AddressExampleFactory extends BaseAddressExampleFactory |
||
13 | { |
||
14 | public function create(array $options = []): AddressInterface |
||
15 | { |
||
16 | $address = parent::create($options); |
||
17 | |||
18 | if (!$address instanceof VatNumberAddressInterface) { |
||
19 | return $address; |
||
20 | } |
||
21 | |||
22 | if (isset($options['vat_number'])) { |
||
23 | $address->setVatNumber((string) $options['vat_number']); |
||
24 | } |
||
25 | |||
26 | if (isset($options['vat_valid'])) { |
||
27 | $address->setVatValid((bool) $options['vat_valid']); |
||
28 | } |
||
29 | |||
30 | return $address; |
||
31 | } |
||
32 | |||
33 | protected function configureOptions(OptionsResolver $resolver): void |
||
44 | ; |
||
45 | } |
||
47 |