1 | <?php |
||
8 | class UnstructuredPostalAddress implements PostalAddressInterface |
||
9 | { |
||
10 | /** |
||
11 | * @var array |
||
12 | */ |
||
13 | protected $addressLines; |
||
14 | |||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | protected $country; |
||
19 | |||
20 | /** |
||
21 | * Constructor |
||
22 | * |
||
23 | * @param string $addressLine1 Street name and house number |
||
24 | * @param string $addressLine2 Postcode and town |
||
25 | * @param string $country Country code (ISO 3166-1 alpha-2) |
||
26 | * |
||
27 | * @throws \InvalidArgumentException When the address contains invalid characters or is too long. |
||
28 | */ |
||
29 | 3 | public function __construct($addressLine1 = null, $addressLine2 = null, $country = 'CH') |
|
40 | |||
41 | /** |
||
42 | * Creates a new instance after sanitizing all inputs |
||
43 | * |
||
44 | * @param string $addressLine1 Street name and house number |
||
45 | * @param string $addressLine2 Postcode and town |
||
46 | * @param string $country Country code (ISO 3166-1 alpha-2) |
||
47 | * |
||
48 | * @return UnstructuredPostalAddress |
||
49 | */ |
||
50 | 1 | public static function sanitize($addressLine1 = null, $addressLine2 = null, $country = 'CH') |
|
58 | |||
59 | /** |
||
60 | * {@inheritdoc} |
||
61 | */ |
||
62 | 2 | public function asDom(\DOMDocument $doc) |
|
73 | } |
||
74 |