From 4b201a49e640f163a8c65f22a44269b40d37d8cc Mon Sep 17 00:00:00 2001 From: Reindert Date: Thu, 26 Oct 2017 14:11:04 +0200 Subject: [PATCH] Check if address is correct --- composer.json | 2 +- .../Repository/MyParcelConsignmentRepository.php | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ef466631..8bfd7420 100755 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "myparcelnl/sdk", - "version": "v1.2.3", + "version": "v1.2.4", "description": "This package is designed to send and receive data from MyParcel by means of an API.", "homepage": "https://www.myparcel.nl", "tags": ["MyParcel", "My Parcel", "Post NL", "PostNL"], diff --git a/src/Model/Repository/MyParcelConsignmentRepository.php b/src/Model/Repository/MyParcelConsignmentRepository.php index 78f98b25..9255576b 100755 --- a/src/Model/Repository/MyParcelConsignmentRepository.php +++ b/src/Model/Repository/MyParcelConsignmentRepository.php @@ -284,8 +284,23 @@ public function encodeReturnShipment(){ return $data; } + /** + * Check if address is correct + * Only for Dutch addresses + * + * @param $fullStreet + * @return bool + */ + public function isCorrectAddress($fullStreet) + { + $result = preg_match(self::SPLIT_STREET_REGEX, $fullStreet, $matches); + + return (bool)$result; + } + /** * Splits street data into separate parts for street name, house number and extension. + * Only for Dutch addresses * * @param string $fullStreet The full street name including all parts *