Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ColissimoLabel.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class ColissimoLabel extends BaseModule
/**
* @param ConnectionInterface|null $con
*/
public function postActivation(ConnectionInterface $con = null): void
public function postActivation(?ConnectionInterface $con = null): void
{
static::checkLabelFolder();

Expand All @@ -114,7 +114,7 @@ public function postActivation(ConnectionInterface $con = null): void
$this->checkConfigurationsValues();
}

public function update($currentVersion, $newVersion, ConnectionInterface $con = null): void
public function update($currentVersion, $newVersion, ?ConnectionInterface $con = null): void
{
$finder = Finder::create()
->name('*.sql')
Expand Down Expand Up @@ -419,7 +419,7 @@ public static function removeAccents($str): bool|string
public static function configureServices(ServicesConfigurator $servicesConfigurator): void
{
$servicesConfigurator->load(self::getModuleCode().'\\', __DIR__)
->exclude([THELIA_MODULE_DIR.ucfirst(self::getModuleCode()).'/I18n/*'])
->exclude([__DIR__.'/I18n/*'])
->autowire()
->autoconfigure();
}
Expand Down
2 changes: 1 addition & 1 deletion Config/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<language>en_US</language>
<language>fr_FR</language>
</languages>
<version>3.0.2</version>
<version>3.0.3</version>
<authors>
<author>
<name>Gilles Bourgeat</name>
Expand Down
2 changes: 1 addition & 1 deletion EventListeners/GenerateLabelListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function __construct(
) {
}

public function generateLabel(GenerateLabelEvent $event): void
public function generateLabel(object $event): void
{
$deliveryModuleCode = $event->getOrder()->getModuleRelatedByDeliveryModuleId()?->getCode();
if ($deliveryModuleCode === "ColissimoHomeDelivery" || $deliveryModuleCode === "ColissimoPickupPoint"|| $deliveryModuleCode === "SoColissimo") {
Expand Down
1 change: 1 addition & 0 deletions EventListeners/UpdateDeliveryAddressListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ protected function generateLabel(Order $order, $weight, $signedDelivery): void

/* Check if delivery is a relay point through ColissimoPickupPoint. Use relay point address if it is */
if (AuthorizedModuleEnum::ColissimoPickupPoint->value === $order->getModuleRelatedByDeliveryModuleId()->getCode() &&
class_exists(OrderAddressColissimoPickupPointQuery::class) &&
null !== ($AddressColissimoPickupPoint = OrderAddressColissimoPickupPointQuery::create()
->findOneById($order->getDeliveryOrderAddressId()))
&& $AddressColissimoPickupPoint) {
Expand Down
3 changes: 2 additions & 1 deletion Service/LabelService.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ public function generateLabel($data, EventDispatcherInterface $dispatcher): arra
$colissimoRequest = null;

/* Same thing with ColissimoPickupPoint */
if (AuthorizedModuleEnum::ColissimoPickupPoint->value === $order->getModuleRelatedByDeliveryModuleId()->getCode()) {
if (AuthorizedModuleEnum::ColissimoPickupPoint->value === $order->getModuleRelatedByDeliveryModuleId()->getCode()
&& class_exists(OrderAddressColissimoPickupPointQuery::class)) {
if (null !== $AddressColissimoPickupPoint = OrderAddressColissimoPickupPointQuery::create()
->findOneById($order->getDeliveryOrderAddressId())) {
/* If the delivery is through a relay point, we create a new LabelRequest with the relay point and order infos */
Expand Down
Loading