Skip to content
This repository was archived by the owner on Feb 5, 2024. It is now read-only.

Commit 9f92a64

Browse files
committed
Release version 2.0.20
ISSUE: CS-4605
1 parent f04a76e commit 9f92a64

File tree

12 files changed

+43
-20
lines changed

12 files changed

+43
-20
lines changed

Controller/Adminhtml/AutoConnect/AutoGenerateApiUser.php

+4-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use SendCloud\SendCloud\Logger\SendCloudLogger;
66
use Magento\Authorization\Model\RoleFactory;
77
use Magento\Authorization\Model\RulesFactory;
8-
use Magento\Setup\Exception;
98
use Magento\User\Model\UserFactory;
109
use Magento\Authorization\Model\Acl\Role\Group as RoleGroup;
1110
use Magento\Authorization\Model\UserContextInterface;
@@ -74,7 +73,7 @@ public function __construct(
7473
* @param $password
7574
* @param int|null $store
7675
* @return array|false
77-
* @throws Exception
76+
* @throws \Exception
7877
* @throws \Magento\Framework\Exception\NoSuchEntityException
7978
*/
8079
public function getApiUser($password, $store)
@@ -95,7 +94,7 @@ public function getApiUser($password, $store)
9594
$apiUser->save();
9695
} catch (\Exception $ex) {
9796
$this->logger->debug($ex->getMessage());
98-
throw new Exception($ex->getMessage());
97+
throw new \Exception($ex->getMessage());
9998
}
10099

101100
$apiUserArray = [
@@ -161,7 +160,7 @@ public function createApiUser($password, $store)
161160
* Create Api Role
162161
*
163162
* @return \Magento\Authorization\Model\Role
164-
* @throws Exception
163+
* @throws \Exception
165164
*/
166165
private function generateApiRole()
167166
{
@@ -186,7 +185,7 @@ private function generateApiRole()
186185
$role->save();
187186
} catch (\Exception $ex) {
188187
$this->logger->debug($ex->getMessage());
189-
throw new Exception($ex->getMessage());
188+
throw new \Exception($ex->getMessage());
190189
}
191190

192191
$this->rulesFactory->create()

Controller/Adminhtml/AutoConnect/Connector.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function __construct(
7070

7171
/**
7272
* @return \Magento\Framework\App\ResponseInterface|\Magento\Framework\Controller\ResultInterface
73-
* @throws \Magento\Setup\Exception
73+
* @throws \Exception
7474
*/
7575
public function execute()
7676
{

Controller/Adminhtml/Configuration/Save.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ public function execute()
4343
$this->writer->save('sendcloud/general/enable', $data['is_active']);
4444
$this->scopeConfig->reinit();
4545

46-
$this->_redirect('sendcloud/configuration/index/store/');
46+
return $this->_redirect('sendcloud/configuration/index/store/');
47+
}
4748

48-
} else {
49-
$this->writer->save('sendcloud/general/enable', $data['is_active'], ScopeInterface::SCOPE_STORES, (int)$data['store_id']);
50-
$this->scopeConfig->reinit();
49+
$this->writer->save('sendcloud/general/enable', $data['is_active'], ScopeInterface::SCOPE_STORES, (int)$data['store_id']);
50+
$this->scopeConfig->reinit();
51+
52+
return $this->_redirect("sendcloud/configuration/index/store/$storeId");
5153

52-
$this->_redirect("sendcloud/configuration/index/store/$storeId");
53-
}
5454
}
5555
}

Model/CheckoutConfiguration.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function update($store_view_id, $checkout_configuration)
103103
\Magento\Framework\Webapi\Exception::HTTP_BAD_REQUEST,
104104
$this->formatErrorData($e->getValidationErrors())
105105
);
106-
} catch (Exception $e) {
106+
} catch (\Exception $e) {
107107
$this->logger->error(('Failed to update checkout configuration: ' . $e->getMessage()));
108108
throw new \Magento\Framework\Webapi\Exception(
109109
__('Invalid checkout payload.'),
@@ -142,7 +142,7 @@ public function delete($store_view_id)
142142
$store_view_id
143143
);
144144
$this->scopeConfig->reinit();
145-
} catch (Exception $e) {
145+
} catch (\Exception $e) {
146146
$this->logger->error('Failed to delete checkout configuration: ' . $e->getMessage());
147147
throw new \Magento\Framework\Webapi\Exception(
148148
__('Failed to delete checkout configuration.'),
@@ -171,7 +171,7 @@ public function deleteIntegration($store_view_id)
171171
$store_view_id
172172
);
173173
$this->scopeConfig->reinit();
174-
} catch (Exception $e) {
174+
} catch (\Exception $e) {
175175
$this->logger->error('Failed to delete integration: ' . $e->getMessage());
176176
throw new \Magento\Framework\Webapi\Exception(
177177
__('Failed to delete integration.'),

Model/ResourceModel/SendcloudDeliveryMethod/Collection.php

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
*/
1616
class Collection extends AbstractCollection implements SearchResultInterface
1717
{
18+
/**
19+
* @var AggregationInterface
20+
*/
21+
private $aggregations;
1822

1923
/**
2024
* Define resource model

Model/ResourceModel/SendcloudDeliveryZone/Collection.php

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
*/
1616
class Collection extends AbstractCollection implements SearchResultInterface
1717
{
18+
/**
19+
* @var AggregationInterface
20+
*/
21+
private $aggregations;
1822

1923
/**
2024
* Define resource model

Plugin/Order/CheckoutOrderRepository.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Magento\Sales\Api\Data\OrderInterface;
88
use Magento\Sales\Api\Data\OrderSearchResultInterface;
99
use Magento\Sales\Model\OrderRepository as MagentoOrderRepository;
10+
use SendCloud\SendCloud\Logger\SendCloudLogger;
1011

1112
/**
1213
* Class OrderRepository
@@ -16,13 +17,18 @@ class CheckoutOrderRepository
1617
/** @var OrderExtensionFactory */
1718
private $orderExtensionFactory;
1819

20+
/** @var SendCloudLogger */
21+
private $logger;
22+
1923
/**
2024
* OrderRepository constructor.
2125
* @param OrderExtensionFactory $orderExtensionFactory
26+
* @param SendCloudLogger $logger
2227
*/
23-
public function __construct(OrderExtensionFactory $orderExtensionFactory)
28+
public function __construct(OrderExtensionFactory $orderExtensionFactory, SendCloudLogger $logger)
2429
{
2530
$this->orderExtensionFactory = $orderExtensionFactory;
31+
$this->logger = $logger;
2632
}
2733

2834
/**

Plugin/Order/OrderRepository.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Magento\Sales\Api\Data\OrderInterface;
88
use Magento\Sales\Api\Data\OrderSearchResultInterface;
99
use Magento\Sales\Model\OrderRepository as MagentoOrderRepository;
10+
use SendCloud\SendCloud\Logger\SendCloudLogger;
1011

1112
/**
1213
* Class OrderRepository
@@ -16,13 +17,18 @@ class OrderRepository
1617
/** @var OrderExtensionFactory */
1718
private $orderExtensionFactory;
1819

20+
/** @var SendCloudLogger */
21+
private $logger;
22+
1923
/**
2024
* OrderRepository constructor.
2125
* @param OrderExtensionFactory $orderExtensionFactory
26+
* @param SendCloudLogger $logger
2227
*/
23-
public function __construct(OrderExtensionFactory $orderExtensionFactory)
28+
public function __construct(OrderExtensionFactory $orderExtensionFactory, SendCloudLogger $logger)
2429
{
2530
$this->orderExtensionFactory = $orderExtensionFactory;
31+
$this->logger = $logger;
2632
}
2733

2834
/**

Setup/Patch/Data/UpdateInternationalShipping.php

+2
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ public function apply()
9999
$this->moduleDataSetup->getConnection()->endSetup();
100100

101101
$connection->endSetup();
102+
103+
return $this;
102104
}
103105

104106
/**

Setup/Patch/Data/UpdateServicePoint.php

+2
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ public function apply()
103103
$this->moduleDataSetup->getConnection()->endSetup();
104104

105105
$connection->endSetup();
106+
107+
return $this;
106108
}
107109

108110
/**

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"type": "magento2-module",
55
"homepage": "https://www.sendcloud.com/",
66
"license": "Apache-2.0",
7-
"version": "2.0.19",
7+
"version": "2.0.20",
88
"require": {
9-
"php": "~7.0|~7.1|~7.2|~7.3|~7.4|~8.1"
9+
"php": "~7.1.0|~7.2.0|~7.3.0|~7.4.0|~8.1.0|~8.2.0"
1010
},
1111
"require-dev": {
1212
"phpunit/phpunit": "^5.7 || ^6.5 || ^7.1"

etc/module.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0"?>
22
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
3-
<module name="SendCloud_SendCloud" setup_version="2.0.19">
3+
<module name="SendCloud_SendCloud" setup_version="2.0.20">
44
<sequence>
55
<module name="Magento_Shipping"/>
66
<module name="Magento_Multishipping"/>

0 commit comments

Comments
 (0)