Skip to content

Commit

Permalink
Merge pull request #62 from myparcelnl/Fix-EU_COUNTRIES
Browse files Browse the repository at this point in the history
change isCdCountry to public function
  • Loading branch information
Reindert authored Aug 1, 2018
2 parents 11cfad9 + 4707d05 commit 20ba514
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 42 deletions.
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.3.14",
"version": "v1.3.15",
"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
82 changes: 41 additions & 41 deletions src/Model/Repository/MyParcelConsignmentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,47 @@ public function isCorrectAddress($fullStreet)
return (bool) $result;
}

/**
* Check if the address is outside the EU
*
* @return bool
*/
public function isCdCountry()
{
return !in_array(
$this->getCountry(),
array (
'NL',
'BE',
'AT',
'BG',
'CZ',
'CY',
'DK',
'EE',
'FI',
'FR',
'DE',
'GB',
'GR',
'HU',
'IE',
'IT',
'LV',
'LT',
'LU',
'PL',
'PT',
'RO',
'SK',
'SI',
'ES',
'SE',
'XK',
)
);
}

/**
* Splits street data into separate parts for street name, house number and extension.
* Only for Dutch addresses
Expand Down Expand Up @@ -374,47 +415,6 @@ private function splitStreet($fullStreet)
return $streetData;
}

/**
* Check if the address is outside the EU
*
* @return bool
*/
protected function isCdCountry()
{
return !in_array(
$this->getCountry(),
array (
'NL',
'BE',
'AT',
'BG',
'CZ',
'CY',
'DK',
'EE',
'FI',
'FR',
'DE',
'GB',
'GR',
'HU',
'IE',
'IT',
'LV',
'LT',
'LU',
'PL',
'PT',
'RO',
'SK',
'SI',
'ES',
'SE',
'XK',
)
);
}

/**
* @return $this
*/
Expand Down

0 comments on commit 20ba514

Please sign in to comment.