|
| 1 | +<?php |
| 2 | + |
| 3 | +namespace Markup\AddressingBundle\Checker; |
| 4 | + |
| 5 | +use Markup\Addressing\AddressInterface; |
| 6 | + |
| 7 | +class AddressUnderCheck implements AddressInterface |
| 8 | +{ |
| 9 | + /** |
| 10 | + * @var string |
| 11 | + */ |
| 12 | + private $postalCode; |
| 13 | + |
| 14 | + /** |
| 15 | + * @var string |
| 16 | + */ |
| 17 | + private $country; |
| 18 | + |
| 19 | + /** |
| 20 | + * @param string $postalCode |
| 21 | + * @param string $country |
| 22 | + */ |
| 23 | + public function __construct($postalCode, $country) |
| 24 | + { |
| 25 | + $this->postalCode = $postalCode; |
| 26 | + $this->country = $country; |
| 27 | + } |
| 28 | + |
| 29 | + /** |
| 30 | + * Gets a name for the recipient at this address. Returns null if one is not specified. |
| 31 | + * |
| 32 | + * @return string|null |
| 33 | + **/ |
| 34 | + public function getRecipient() |
| 35 | + { |
| 36 | + return null; |
| 37 | + } |
| 38 | + |
| 39 | + /** |
| 40 | + * Gets whether the address has a recipient defined. |
| 41 | + * |
| 42 | + * @return bool |
| 43 | + **/ |
| 44 | + public function hasRecipient() |
| 45 | + { |
| 46 | + return false;// TODO: Implement hasRecipient() method. |
| 47 | + } |
| 48 | + |
| 49 | + /** |
| 50 | + * Gets the numbered address line, counting from one. If there is no address line for provided number, return null. |
| 51 | + * |
| 52 | + * @param int $lineNumber |
| 53 | + * @return string|null |
| 54 | + **/ |
| 55 | + public function getStreetAddressLine($lineNumber) |
| 56 | + { |
| 57 | + return null; |
| 58 | + } |
| 59 | + |
| 60 | + /** |
| 61 | + * Gets the address lines that are part of the street address - i.e. everything up until the postal town. |
| 62 | + * |
| 63 | + * @return array |
| 64 | + **/ |
| 65 | + public function getStreetAddressLines() |
| 66 | + { |
| 67 | + return []; |
| 68 | + } |
| 69 | + |
| 70 | + /** |
| 71 | + * Gets the locality for this address. This field is often referred to as a "town" or a "city". |
| 72 | + * |
| 73 | + * @return string |
| 74 | + **/ |
| 75 | + public function getLocality() |
| 76 | + { |
| 77 | + return ''; |
| 78 | + } |
| 79 | + |
| 80 | + /** |
| 81 | + * Gets the region for this address. This field is often referred to as a "county", "state" or "province". |
| 82 | + * If no region is indicated as part of the address information, returns an empty string. |
| 83 | + * |
| 84 | + * @return string |
| 85 | + **/ |
| 86 | + public function getRegion() |
| 87 | + { |
| 88 | + return ''; |
| 89 | + } |
| 90 | + |
| 91 | + /** |
| 92 | + * Gets the postal code for this address. |
| 93 | + * If no postal code is indicated as part of the address information, returns an empty string. |
| 94 | + * |
| 95 | + * @return string |
| 96 | + **/ |
| 97 | + public function getPostalCode() |
| 98 | + { |
| 99 | + return $this->postalCode; |
| 100 | + } |
| 101 | + |
| 102 | + /** |
| 103 | + * Gets the ISO-3166-2 (alpha-2) representation of the country indicated for this address. |
| 104 | + * i.e. 'GB' for United Kingdom (*not* 'UK'), 'US' for United States. |
| 105 | + * |
| 106 | + * @return string |
| 107 | + **/ |
| 108 | + public function getCountry() |
| 109 | + { |
| 110 | + return $this->country; |
| 111 | + } |
| 112 | +} |
0 commit comments