Skip to content

Commit

Permalink
v1.0.8 - fix for php8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew committed Sep 12, 2024
1 parent a695d4d commit a3fa241
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Model/Carrier/ScheduledToDoor.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class ScheduledToDoor extends AbstractCarrier implements CarrierInterface
private ConfigurationProvider $configurationProvider;

/**
* Constructor Express
* Constructor ScheduledToDoor
*
* @param ScopeConfigInterface $scopeConfig
* @param ErrorFactory $rateErrorFactory
Expand Down
3 changes: 2 additions & 1 deletion Model/Carrier/ScheduledToParcel.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class ScheduledToParcel extends AbstractCarrier implements CarrierInterface
private ParcelMachines $parcelMachines;

/**
* Constructor Express
* Constructor ScheduledToParcel
*
* @param ScopeConfigInterface $scopeConfig
* @param ErrorFactory $rateErrorFactory
Expand All @@ -86,6 +86,7 @@ class ScheduledToParcel extends AbstractCarrier implements CarrierInterface
* @param ShippingCost $shippingCost
* @param Session $_checkoutSession
* @param ConfigurationProvider $configurationProvider
* @param ParcelMachines $parcelMachines
* @param array $data
*/
public function __construct(
Expand Down
17 changes: 11 additions & 6 deletions Model/ShippingMethodManagement.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ class ShippingMethodManagement implements \Qwqer\Express\Api\ShipmentEstimationI
/**
* @var Request
*/
private Request $request;
protected Request $request;

/**
* @var QuoteIdMaskFactory
*/
private QuoteIdMaskFactory $quoteIdMaskFactory;
protected QuoteIdMaskFactory $quoteIdMaskFactory;

/**
* @var GeoCode
Expand All @@ -54,7 +54,12 @@ class ShippingMethodManagement implements \Qwqer\Express\Api\ShipmentEstimationI
/**
* @var ParcelMachines
*/
private ParcelMachines $parcelMachines;
protected ParcelMachines $parcelMachines;

/**
* @var ConfigurationProvider
*/
protected ConfigurationProvider $configurationProvider;

/**
* @param CartRepositoryInterface $quoteRepository
Expand All @@ -63,7 +68,7 @@ class ShippingMethodManagement implements \Qwqer\Express\Api\ShipmentEstimationI
* @param GeoCode $geoCode
* @param ShippingCost $shippingCost
* @param ParcelMachines $parcelMachines
* @param ConfigurationProvider $ConfigurationProvider
* @param ConfigurationProvider $configurationProvider
*/
public function __construct(
CartRepositoryInterface $quoteRepository,
Expand All @@ -72,15 +77,15 @@ public function __construct(
GeoCode $geoCode,
ShippingCost $shippingCost,
ParcelMachines $parcelMachines,
ConfigurationProvider $ConfigurationProvider
ConfigurationProvider $configurationProvider
) {
$this->quoteRepository = $quoteRepository;
$this->request = $request;
$this->quoteIdMaskFactory = $quoteIdMaskFactory;
$this->geoCode = $geoCode;
$this->shippingCost = $shippingCost;
$this->parcelMachines = $parcelMachines;
$this->configurationProvider = $ConfigurationProvider;
$this->configurationProvider = $configurationProvider;
}

/**
Expand Down
18 changes: 10 additions & 8 deletions Observer/OrderPlaceBefore.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Exception\LocalizedException;
use Magento\Store\Model\ScopeInterface;
use Qwqer\Express\Model\Carrier\Express;
use Qwqer\Express\Model\Carrier\ScheduledToDoor;
use Qwqer\Express\Model\Carrier\ScheduledToParcel;
use Qwqer\Express\Service\PublishOrder;
use Qwqer\Express\Logger\Logger;
use Qwqer\Express\Provider\ConfigurationProvider;
use Magento\Framework\App\Config\ScopeConfigInterface;

class OrderPlaceBefore implements ObserverInterface
{
Expand All @@ -24,23 +25,23 @@ class OrderPlaceBefore implements ObserverInterface
protected Logger $logger;

/**
* @var ConfigurationProvider
* @var ScopeConfigInterface
*/
protected ConfigurationProvider $ConfigurationProvider;
protected ScopeConfigInterface $scopeConfig;

/**
* @param PublishOrder $publishOrder
* @param Logger $logger
* @param ConfigurationProvider $ConfigurationProvider
* @param ScopeConfigInterface $scopeConfig
*/
public function __construct(
PublishOrder $publishOrder,
Logger $logger,
ConfigurationProvider $ConfigurationProvider
ScopeConfigInterface $scopeConfig
) {
$this->publishOrder = $publishOrder;
$this->logger = $logger;
$this->configurationProvider = $ConfigurationProvider;
$this->scopeConfig = $scopeConfig;
}

/**
Expand All @@ -62,8 +63,9 @@ public function execute(\Magento\Framework\Event\Observer $observer)
)
&& $quote->getShippingAddress()->getQwqerAddress()
) {
$syncAutomatically = $this->configurationProvider->getStoreConfig(
"carriers/".$shippingMethod->getData('carrier_code')."/sync_automatically"
$syncAutomatically = $this->scopeConfig->getValue(
"carriers/".$shippingMethod->getData('carrier_code')."/sync_automatically",
ScopeInterface::SCOPE_STORE
);
if ($syncAutomatically) {
$placedOrder = $this->publishOrder->execute($order, $quote);
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "qwqer/express",
"description": "Magento 2 QWQER Express Delivery - Extension",
"require": {
"php": "~7.4.0||~8.1.0",
"php": "~7.4.0||~8.1.0||~8.2.0",
"magento/framework": "102.0.*",
"magento/module-backend": "101.0.*",
"magento/module-catalog": "103.0.*",
Expand All @@ -15,7 +15,7 @@
"magento/module-store": "101.0.*"
},
"type": "magento2-module",
"version": "1.0.7",
"version": "1.0.8",
"autoload": {
"files": [
"registration.php"
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Qwqer_Express" setup_version="1.0.7">
<module name="Qwqer_Express" setup_version="1.0.8">
<sequence>
<module name="Magento_Checkout"/>
<module name="Magento_Webapi" />
Expand Down

0 comments on commit a3fa241

Please sign in to comment.