Skip to content

Commit

Permalink
Merge pull request #29 from myparcelnl/develop
Browse files Browse the repository at this point in the history
Check if address is correct
  • Loading branch information
Reindert authored Oct 26, 2017
2 parents 69e3065 + 4b201a4 commit ed0fca9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -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"],
Expand Down
15 changes: 15 additions & 0 deletions src/Model/Repository/MyParcelConsignmentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down

0 comments on commit ed0fca9

Please sign in to comment.