Skip to content

Commit

Permalink
Merge pull request #10 from Roshyo/fix-deprecation-and-notices
Browse files Browse the repository at this point in the history
Fix deprecation of ShippingMethodEligibilityCheckerInterface
  • Loading branch information
LucaGallinari authored Jul 15, 2021
2 parents 31d866b + 253ff1b commit accb0fe
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Checker/TableRateShippingMethodEligibilityChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Webgriffe\SyliusTableRateShippingPlugin\Checker;

use Sylius\Component\Core\Model\ShipmentInterface;
use Sylius\Component\Shipping\Checker\ShippingMethodEligibilityCheckerInterface;
use Sylius\Component\Shipping\Checker\Eligibility\ShippingMethodEligibilityCheckerInterface;
use Sylius\Component\Shipping\Model\ShippingMethodInterface;
use Sylius\Component\Shipping\Model\ShippingSubjectInterface;
use Webgriffe\SyliusTableRateShippingPlugin\Calculator\TableRateShippingCalculator;
Expand Down
2 changes: 1 addition & 1 deletion src/EventSubscriber/TableRateDeleteSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct(ShippingMethodRepositoryInterface $shippingMethodRep
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents()
public static function getSubscribedEvents(): array
{
return ['webgriffe.shipping_table_rate.pre_delete' => 'onTableRatePreDelete'];
}
Expand Down
2 changes: 1 addition & 1 deletion src/Form/EventSubscriber/AddCurrencySubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class AddCurrencySubscriber implements EventSubscriberInterface
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents()
public static function getSubscribedEvents(): array
{
return [FormEvents::PRE_SET_DATA => 'preSetData'];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function getParent(): string
return ChannelCollectionType::class;
}

public function getBlockPrefix()
public function getBlockPrefix(): string
{
return 'webgriffe_sylius_table_rate_shipping_plugin_calculator_channel_based_table_rate';
}
Expand Down
1 change: 1 addition & 0 deletions src/Resolver/TableRateResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public function resolve(ShipmentInterface $shipment, array $calculatorConfig): S

/** @var ShippingTableRate $tableRate */
$tableRate = $calculatorConfig[$channelCode][TableRateConfigurationType::TABLE_RATE_FIELD_NAME];
/** @var ShippingTableRate $tableRate */
$tableRate = $this->tableRateRepository->findOneBy(['code' => $tableRate->getCode()]);
Assert::isInstanceOf($tableRate, ShippingTableRate::class);

Expand Down

0 comments on commit accb0fe

Please sign in to comment.