From b8cb35e308b7c136b91be3e4978306c2f54263d1 Mon Sep 17 00:00:00 2001 From: Scrutinizer Auto-Fixer Date: Tue, 24 Apr 2018 06:17:41 +0000 Subject: [PATCH 1/4] Scrutinizer Auto-Fixes This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com --- src/Helper/MyParcelCollection.php | 34 +++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/Helper/MyParcelCollection.php b/src/Helper/MyParcelCollection.php index db2c545b..504372da 100644 --- a/src/Helper/MyParcelCollection.php +++ b/src/Helper/MyParcelCollection.php @@ -73,18 +73,18 @@ class MyParcelCollection private $user_agent = ''; - /** - * @param bool $keepKeys - * - * @return MyParcelConsignmentRepository[] - */ + /** + * @param bool $keepKeys + * + * @return MyParcelConsignmentRepository[] + */ public function getConsignments($keepKeys = true) { - if ( $keepKeys ) { + if ( $keepKeys ) { return $this->consignments; - } + } - return array_values($this->consignments); + return array_values($this->consignments); } /** @@ -177,9 +177,9 @@ public function addConsignment(MyParcelConsignmentRepository $consignment) if (!empty($this->consignments)) { if ($consignment->getReferenceId() === null) { - throw new \Exception('First set the reference id with setReferenceId() before running addConsignment() for multiple shipments'); + throw new \Exception('First set the reference id with setReferenceId() before running addConsignment() for multiple shipments'); } elseif (key_exists($consignment->getReferenceId(), $this->consignments)) { - throw new \Exception('setReferenceId() must be unique. For example, do not use an ID of an order as an order has multiple shipments. In that case, use the shipment ID.'); + throw new \Exception('setReferenceId() must be unique. For example, do not use an ID of an order as an order has multiple shipments. In that case, use the shipment ID.'); } } @@ -225,12 +225,12 @@ public function createConcepts() return $this; } - /** - * Delete concepts in MyParcel - * - * @return $this - * @throws \Exception - */ + /** + * Delete concepts in MyParcel + * + * @return $this + * @throws \Exception + */ public function deleteConcepts() { /* @var $consignments MyParcelConsignmentRepository[] */ @@ -416,7 +416,7 @@ public function downloadPdfOfLabels($inline_download = false) */ public function sendReturnLabelMails() { - $parentConsignment = $this->getConsignments(false)[0]; + $parentConsignment = $this->getConsignments(false)[0]; $apiKey = $parentConsignment->getApiKey(); $data = $this->apiEncodeReturnShipments($parentConsignment); From 14c1359aafde9136902d37cc7392af5ff3aa70b5 Mon Sep 17 00:00:00 2001 From: Scrutinizer Auto-Fixer Date: Tue, 24 Apr 2018 06:20:56 +0000 Subject: [PATCH 2/4] Scrutinizer Auto-Fixes This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com --- src/Helper/MyParcelCollection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Helper/MyParcelCollection.php b/src/Helper/MyParcelCollection.php index 504372da..d4f55d1f 100644 --- a/src/Helper/MyParcelCollection.php +++ b/src/Helper/MyParcelCollection.php @@ -80,7 +80,7 @@ class MyParcelCollection */ public function getConsignments($keepKeys = true) { - if ( $keepKeys ) { + if ($keepKeys) { return $this->consignments; } From 821d2028e2f0a06482104244c0512907331ca117 Mon Sep 17 00:00:00 2001 From: Richard Perdaan Date: Tue, 31 Jul 2018 15:13:00 +0200 Subject: [PATCH 3/4] change isCdCountry to public function --- .../MyParcelConsignmentRepository.php | 82 +++++++++---------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/src/Model/Repository/MyParcelConsignmentRepository.php b/src/Model/Repository/MyParcelConsignmentRepository.php index 1752c0fb..723b64ad 100755 --- a/src/Model/Repository/MyParcelConsignmentRepository.php +++ b/src/Model/Repository/MyParcelConsignmentRepository.php @@ -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 @@ -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 */ From 4707d05fc8a0cf86fefde0379d5dacc3151d738b Mon Sep 17 00:00:00 2001 From: Richard Perdaan Date: Wed, 1 Aug 2018 10:20:49 +0200 Subject: [PATCH 4/4] update version to v1.3.15 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 5dad3e3a..25024957 100755 --- a/composer.json +++ b/composer.json @@ -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"],