Skip to content

Commit 87dd843

Browse files
committed
20.53.0 SHQ23-531 Add support for PHP8.2
1 parent 4c06700 commit 87dd843

14 files changed

+89
-42
lines changed

CHANGELOG-PUBLIC.md

+4
Original file line numberDiff line numberDiff line change
@@ -756,3 +756,7 @@ SHQ23-55 Auto renew auth token for uShip / Shipping Insights if its about to exp
756756
SHQ23-429 Resolve issue with store price using incorrect value when coupon code entered and non base currency selected
757757

758758

759+
## 20.53.0 (2023-05-11)
760+
SHQ23-531 Add support for PHP8.2
761+
762+

CHANGELOG.MD

+4
Original file line numberDiff line numberDiff line change
@@ -756,3 +756,7 @@ SHQ23-55 Auto renew auth token for uShip / Shipping Insights if its about to exp
756756
SHQ23-429 Resolve issue with store price using incorrect value when coupon code entered and non base currency selected
757757

758758

759+
## 20.53.0 (2023-05-11)
760+
SHQ23-531 Add support for PHP8.2
761+
762+

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "shipperhq/module-shipper",
33
"description": "Magento Shipping integration with ShipperHQ",
44
"type": "magento2-module",
5-
"version": "20.52.1",
5+
"version": "20.53.0",
66
"license": [
77
"OSL-3.0",
88
"AFL-3.0"

src/Helper/Data.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper
8181
private $baseCurrencyRate;
8282
private $storeId;
8383
/**
84-
* @var Mage_Sales_Model_Quote
84+
* @var \Magento\Quote\Model\Quote
8585
*/
8686
private $quote;
8787
/**
@@ -123,7 +123,6 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper
123123
private $checkoutHelper;
124124

125125
public function __construct(
126-
Config $shipperConfig,
127126
\Magento\Eav\Model\Config $eavConfig,
128127
\Magento\Framework\Registry $registry,
129128
\Magento\Framework\App\Helper\Context $context,
@@ -136,7 +135,6 @@ public function __construct(
136135
\Magento\Checkout\Helper\Data $checkoutHelper
137136
) {
138137
parent::__construct($context);
139-
$this->shipperConfig = $shipperConfig;
140138
$this->eavConfig = $eavConfig;
141139
$this->registry = $registry;
142140
$this->storeManager = $storeManager;

src/Helper/PostOrder.php

+22-5
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
use ShipperHQ\Shipper\Model\Carrier\Processor\ShipperMapper;
3232
use ShipperHQ\WS\Client\WebServiceClientFactory;
3333
use ShipperHQ\WS\PostOrder\Placeorder\Request\PlaceOrderRequestFactory;
34+
use ShipperHQ\WS\Shared\BasicAddress;
3435
use ShipperHQ\WS\Shared\BasicAddressFactory;
3536
use ShipperHQ\Shipper\Helper\CarrierGroup;
3637

@@ -43,27 +44,42 @@ class PostOrder
4344
* @var LogAssist
4445
*/
4546
private $shipperLogger;
47+
4648
/**
47-
* @var Client\WebServiceClientFactory
49+
* @var \ShipperHQ\WS\Client\WebServiceClientFactory
4850
*/
4951
private $shipperWSClientFactory;
52+
5053
/**
51-
* @var ShipperHQ\WS\PostOrder\Placeorder\Request
54+
* @var \ShipperHQ\WS\PostOrder\Placeorder\Request\PlaceOrderRequestFactory
5255
*/
5356
private $placeOrderRequestFactory;
57+
5458
/**
5559
* @var Data
5660
*/
5761
private $shipperDataHelper;
62+
5863
/**
5964
* @var \ShipperHQ\Shipper\Helper\CarrierGroup
6065
*/
6166
private $carrierGroupHelper;
67+
6268
/**
63-
* @var WS\Shared\BasicAddressFactory
69+
* @var \ShipperHQ\WS\Shared\BasicAddressFactory
6470
*/
6571
private $basicAddressFactory;
6672

73+
/**
74+
* @var \ShipperHQ\Shipper\Helper\Rest
75+
*/
76+
private $restHelper;
77+
78+
/**
79+
* @var \ShipperHQ\Shipper\Model\Carrier\Processor\ShipperMapper
80+
*/
81+
private $shipperMapper;
82+
6783
/**
6884
* PostOrder constructor.
6985
*
@@ -74,6 +90,7 @@ class PostOrder
7490
* @param ShipperMapper $shipperMapper
7591
* @param Data $shipperDataHelper
7692
* @param BasicAddressFactory $basicAddressFactory
93+
* @param CarrierGroup $carrierGroupHelper
7794
*/
7895
public function __construct(
7996
LogAssist $shipperLogger,
@@ -202,9 +219,9 @@ private function getPlaceorderRequest($order, $rate)
202219
/**
203220
* Get values for recipient
204221
*
205-
* @param $request
222+
* @param $shippingAddress
206223
*
207-
* @return array
224+
* @return BasicAddress
208225
*/
209226
private function getRecipient($shippingAddress)
210227
{

src/Helper/Rest.php

+18-23
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,24 @@
11
<?php
22
/**
3-
*
43
* ShipperHQ Shipping Module
5-
*
64
* NOTICE OF LICENSE
7-
*
85
* This source file is subject to the Open Software License (OSL 3.0)
96
* that is bundled with this package in the file LICENSE.txt.
107
* It is also available through the world-wide-web at this URL:
118
* http://opensource.org/licenses/osl-3.0.php
129
* If you did not receive a copy of the license and are unable to
1310
* obtain it through the world-wide-web, please send an email
1411
* to license@magentocommerce.com so we can send you a copy immediately.
15-
*
1612
* DISCLAIMER
17-
*
1813
* Do not edit or add to this file if you wish to upgrade Magento to newer
1914
* versions in the future. If you wish to customize Magento for your
2015
* needs please refer to http://www.magentocommerce.com for more information.
21-
*
2216
* Shipper HQ Shipping
23-
*
24-
* @category ShipperHQ
25-
* @package ShipperHQ_Shipping_Carrier
17+
* @category ShipperHQ
18+
* @package ShipperHQ_Shipping_Carrier
2619
* @copyright Copyright (c) 2015 Zowta LLC (http://www.ShipperHQ.com)
27-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
28-
* @author ShipperHQ Team sales@shipperhq.com
20+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21+
* @author ShipperHQ Team sales@shipperhq.com
2922
*/
3023

3124
/**
@@ -36,29 +29,31 @@
3629
namespace ShipperHQ\Shipper\Helper;
3730

3831
use Magento\Framework\App\Config\ScopeConfigInterface;
32+
use Magento\Store\Model\ScopeInterface;
3933

4034
/**
4135
* Shipping data helper
4236
*/
4337
class Rest
4438
{
39+
/**
40+
* @var string
41+
*/
4542
private static $wsTimeout;
4643

4744
/**
4845
* @var \ShipperHQ\Lib\Helper\Rest
4946
*/
5047
private $restHelper;
48+
5149
/**
5250
* @var ScopeConfigInterface
5351
*/
5452
private $config;
55-
/**
56-
* @var Data $shipperHelperData
57-
*/
5853

5954
/**
6055
* @param \ShipperHQ\Lib\Helper\Rest $restHelper
61-
* @param ScopeConfigInterface $config
56+
* @param ScopeConfigInterface $config
6257
*/
6358
public function __construct(
6459
\ShipperHQ\Lib\Helper\Rest $restHelper,
@@ -78,29 +73,28 @@ private function getGatewayUrl()
7873
{
7974
$live = $this->cleanUpUrl($this->config->getValue(
8075
'carriers/shipper/live_url',
81-
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
76+
ScopeInterface::SCOPE_STORE
8277
));
83-
8478
$test = $this->cleanUpUrl($this->config->getValue(
8579
'carriers/shipper/url',
86-
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
80+
ScopeInterface::SCOPE_STORE
8781
));
82+
8883
return $this->config->isSetFlag(
8984
'carriers/shipper/sandbox_mode',
90-
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
85+
ScopeInterface::SCOPE_STORE
9186
) ? $test : $live;
9287
}
9388

9489
/**
9590
* Returns place order endpoint
96-
*
9791
* @return string
9892
*/
9993
private function getPostOrderGatewayUrl()
10094
{
10195
return $this->cleanUpUrl($this->config->getValue(
10296
'carriers/shipper/postorder_rest_url',
103-
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
97+
ScopeInterface::SCOPE_STORE
10498
));
10599
}
106100

@@ -111,6 +105,7 @@ private function cleanUpUrl($urlStart)
111105
if ($lastChar != '/') {
112106
$url .= '/';
113107
}
108+
114109
return $url;
115110
}
116111

@@ -144,7 +139,6 @@ public function getPlaceorderGatewayUrl()
144139
/*
145140
* Retrieve configured timeout for webservice
146141
*/
147-
148142
public function getAttributeGatewayUrl()
149143
{
150144
return $this->restHelper->getAttributeGatewayUrl();
@@ -160,13 +154,14 @@ public function getWebserviceTimeout()
160154
if (self::$wsTimeout == null) {
161155
$timeout = $this->config->getValue(
162156
'carriers/shipper/ws_timeout',
163-
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
157+
ScopeInterface::SCOPE_STORE
164158
);
165159
if (!is_numeric($timeout)) {
166160
$timeout = 30;
167161
}
168162
self::$wsTimeout = $timeout;
169163
}
164+
170165
return self::$wsTimeout;
171166
}
172167
}

src/Model/Carrier/Processor/CarrierConfigHandler.php

+15-6
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,32 @@
3030

3131
namespace ShipperHQ\Shipper\Model\Carrier\Processor;
3232

33+
use Magento\Backend\Block\Template\Context;
34+
use Magento\Config\Model\ResourceModel\Config;
35+
use ShipperHQ\Shipper\Helper\Data;
36+
3337
class CarrierConfigHandler
3438
{
3539
/**
36-
* @var \ShipperHQ\Shipper\Helper\Data
40+
* @var Data
3741
*/
3842
private $shipperDataHelper;
3943

4044
/**
41-
* @var \Magento\Config\Model\ResourceModel\Config
45+
* @var Config
4246
*/
4347
private $resourceConfig;
4448

49+
/**
50+
* @var \Magento\Store\Model\StoreManagerInterface
51+
*/
52+
private $storeManager;
53+
4554

4655
public function __construct(
47-
\Magento\Config\Model\ResourceModel\Config $resourceConfig,
48-
\Magento\Backend\Block\Template\Context $context,
49-
\ShipperHQ\Shipper\Helper\Data $shipperDataHelper
56+
Config $resourceConfig,
57+
Context $context,
58+
Data $shipperDataHelper
5059
) {
5160
$this->shipperDataHelper = $shipperDataHelper;
5261
$this->storeManager = $context->getStoreManager();
@@ -56,7 +65,7 @@ public function __construct(
5665
public function saveCarrierResponseDetails($carrierRate, $carrierGroupDetail = null)
5766
{
5867
$carrierCode = $carrierRate['carrierCode'];
59-
$sort = isset($carrierRate['sortOrder']) ? $carrierRate['sortOrder'] : false;
68+
$sort = $carrierRate['sortOrder'] ?? false;
6069
$this->dynamicCarrierConfig($carrierCode, $carrierRate['carrierTitle'], $sort);
6170

6271
$this->populateCarrierLevelDetails((array)$carrierRate, $carrierGroupDetail);

src/Model/Carrier/Processor/ListingMapper.php

+5
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ class ListingMapper
7070
*/
7171
private $mediaDirectory;
7272

73+
/**
74+
* @var \Magento\Store\Model\StoreManagerInterface
75+
*/
76+
private $storeManager;
77+
7378
private static $dim_height = 'ship_height';
7479
private static $dim_width = 'ship_width';
7580
private static $dim_length = 'ship_length';

src/Model/Carrier/Shipper.php

+5
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,11 @@ class Shipper extends AbstractCarrier implements CarrierInterface
185185
*/
186186
private $directoryHelper;
187187

188+
/**
189+
* @var \ShipperHQ\Shipper\Model\Carrier\Processor\ShipperMapper
190+
*/
191+
private $shipperMapper;
192+
188193
/**
189194
* @param \ShipperHQ\Shipper\Helper\Data $shipperDataHelper
190195
* @param \ShipperHQ\Shipper\Helper\Rest $restHelper

src/Setup/Patch/Data/InstallAvailabilityDateAttribute.php

+5
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ class InstallAvailabilityDateAttribute implements DataPatchInterface, PatchRever
2626
*/
2727
private $moduleDataSetup;
2828

29+
/**
30+
* @var \Magento\Catalog\Setup\CategorySetup
31+
*/
32+
private $categorySetupFactory;
33+
2934
/**
3035
* @param ModuleDataSetupInterface $moduleDataSetup
3136
*/

src/Setup/Patch/Data/UpdateMagentoVersionInConfig.php

+5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ class UpdateMagentoVersionInConfig implements DataPatchInterface, PatchRevertabl
2525
*/
2626
private $configStorageWriter;
2727

28+
/**
29+
* @var ProductMetadata
30+
*/
31+
private $productMetadata;
32+
2833
/**
2934
* @param ModuleDataSetupInterface $moduleDataSetup
3035
*/

src/Setup/Patch/Schema/AddUniqueIndexToDetailGrid.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ class AddUniqueIndexToDetailGrid implements SchemaPatchInterface
2626
private static $connectionName = 'sales';
2727

2828
/**
29-
* @var ModuleDataSetupInterface $moduleDataSetup
29+
* @var SchemaSetupInterface
3030
*/
31-
private $moduleDataSetup;
31+
private $schemaSetup;
3232

3333
/**
3434
* @param ModuleDataSetupInterface $moduleDataSetup

src/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "shipperhq/module-shipper",
33
"description": "Magento Shipping integration with ShipperHQ",
44
"type": "magento2-module",
5-
"version": "20.52.1",
5+
"version": "20.53.0",
66
"license": [
77
"OSL-3.0",
88
"AFL-3.0"

src/etc/config.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
<ws_timeout>30</ws_timeout>
6868
<use_cache>0</use_cache>
6969
<always_use_cache>1</always_use_cache>
70-
<extension_version>20.52.1</extension_version>
70+
<extension_version>20.53.0</extension_version>
7171
<allowed_methods></allowed_methods>
7272
<magento_version></magento_version>
7373
<cache_timeout>300</cache_timeout>

0 commit comments

Comments
 (0)