Skip to content

Commit

Permalink
Use PHP 7.4 syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
GSadee committed Sep 6, 2021
1 parent 5a59100 commit 79fede9
Show file tree
Hide file tree
Showing 72 changed files with 238 additions and 428 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@
"matthiasnoback/symfony-config-test": "^4.0",
"matthiasnoback/symfony-dependency-injection-test": "^4.1",
"phpspec/phpspec": "^7.0",
"phpstan/phpstan": "0.12.84",
"phpstan/phpstan": "0.12.96",
"phpstan/phpstan-webmozart-assert": "0.12.12",
"phpunit/phpunit": "^9.5",
"rector/rector": "^0.11.52",
"sylius-labs/coding-standard": "^4.0",
"symfony/browser-kit": "^4.4 || ^5.2",
"symfony/debug-bundle": "^4.4 || ^5.2",
Expand Down
18 changes: 18 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

use Rector\Core\Configuration\Option;
use Rector\Php74\Rector\Property\TypedPropertyRector;
use Rector\Set\ValueObject\SetList;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

return static function (ContainerConfigurator $containerConfigurator): void
{
$parameters = $containerConfigurator->parameters();
$parameters->set(Option::AUTO_IMPORT_NAMES, true);
$parameters->set(Option::IMPORT_SHORT_CLASSES, false);

$services = $containerConfigurator->services();
$services->set(TypedPropertyRector::class);
};
6 changes: 2 additions & 4 deletions src/Action/Admin/DownloadCreditMemoAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@

final class DownloadCreditMemoAction
{
/** @var CreditMemoPdfFileGeneratorInterface */
private $creditMemoPdfFileGenerator;
private CreditMemoPdfFileGeneratorInterface $creditMemoPdfFileGenerator;

/** @var CreditMemoFileResponseBuilderInterface */
private $creditMemoFileResponseBuilder;
private CreditMemoFileResponseBuilderInterface $creditMemoFileResponseBuilder;

public function __construct(
CreditMemoPdfFileGeneratorInterface $creditMemoPdfFileGenerator,
Expand Down
18 changes: 6 additions & 12 deletions src/Action/Admin/OrderRefundsListAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,17 @@

final class OrderRefundsListAction
{
/** @var OrderRepositoryInterface */
private $orderRepository;
private OrderRepositoryInterface $orderRepository;

/** @var OrderRefundingAvailabilityCheckerInterface */
private $orderRefundsListAvailabilityChecker;
private OrderRefundingAvailabilityCheckerInterface $orderRefundsListAvailabilityChecker;

/** @var RefundPaymentMethodsProviderInterface */
private $refundPaymentMethodsProvider;
private RefundPaymentMethodsProviderInterface $refundPaymentMethodsProvider;

/** @var Environment */
private $twig;
private Environment $twig;

/** @var Session */
private $session;
private Session $session;

/** @var UrlGeneratorInterface */
private $router;
private UrlGeneratorInterface $router;

public function __construct(
OrderRepositoryInterface $orderRepository,
Expand Down
15 changes: 5 additions & 10 deletions src/Action/Admin/RefundUnitsAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,15 @@

final class RefundUnitsAction
{
/** @var MessageBusInterface */
private $commandBus;
private MessageBusInterface $commandBus;

/** @var Session */
private $session;
private Session $session;

/** @var UrlGeneratorInterface */
private $router;
private UrlGeneratorInterface $router;

/** @var RefundUnitsCommandCreatorInterface */
private $commandCreator;
private RefundUnitsCommandCreatorInterface $commandCreator;

/** @var LoggerInterface */
private $logger;
private LoggerInterface $logger;

public function __construct(
MessageBusInterface $commandBus,
Expand Down
12 changes: 4 additions & 8 deletions src/Action/Admin/SendCreditMemoAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,13 @@

final class SendCreditMemoAction
{
/** @var MessageBusInterface */
private $commandBus;
private MessageBusInterface $commandBus;

/** @var RepositoryInterface */
private $creditMemoRepository;
private RepositoryInterface $creditMemoRepository;

/** @var Session */
private $session;
private Session $session;

/** @var UrlGeneratorInterface */
private $router;
private UrlGeneratorInterface $router;

public function __construct(
MessageBusInterface $commandBus,
Expand Down
15 changes: 5 additions & 10 deletions src/Action/CompleteRefundPaymentAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,15 @@

final class CompleteRefundPaymentAction
{
/** @var Session */
private $session;
private Session $session;

/** @var ObjectRepository */
private $refundPaymentRepository;
private ObjectRepository $refundPaymentRepository;

/** @var RefundPaymentCompletedStateApplierInterface */
private $refundPaymentCompletedStateApplier;
private RefundPaymentCompletedStateApplierInterface $refundPaymentCompletedStateApplier;

/** @var RouterInterface */
private $router;
private RouterInterface $router;

/** @var OrderRepositoryInterface */
private $orderRepository;
private OrderRepositoryInterface $orderRepository;

public function __construct(
Session $session,
Expand Down
9 changes: 3 additions & 6 deletions src/Action/Shop/DownloadCreditMemoAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,11 @@

final class DownloadCreditMemoAction
{
/** @var CreditMemoPdfFileGeneratorInterface */
private $creditMemoPdfFileGenerator;
private CreditMemoPdfFileGeneratorInterface $creditMemoPdfFileGenerator;

/** @var CreditMemoCustomerRelationCheckerInterface */
private $creditMemoCustomerRelationChecker;
private CreditMemoCustomerRelationCheckerInterface $creditMemoCustomerRelationChecker;

/** @var CreditMemoFileResponseBuilderInterface */
private $creditMemoFileResponseBuilder;
private CreditMemoFileResponseBuilderInterface $creditMemoFileResponseBuilder;

public function __construct(
CreditMemoPdfFileGeneratorInterface $creditMemoPdfFileGenerator,
Expand Down
3 changes: 1 addition & 2 deletions src/Calculator/UnitRefundTotalCalculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@

final class UnitRefundTotalCalculator implements UnitRefundTotalCalculatorInterface
{
/** @var RemainingTotalProviderInterface */
private $remainingTotalProvider;
private RemainingTotalProviderInterface $remainingTotalProvider;

public function __construct(RemainingTotalProviderInterface $remainingTotalProvider)
{
Expand Down
6 changes: 2 additions & 4 deletions src/Checker/CreditMemoCustomerRelationChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@

final class CreditMemoCustomerRelationChecker implements CreditMemoCustomerRelationCheckerInterface
{
/** @var CustomerContextInterface */
private $customerContext;
private CustomerContextInterface $customerContext;

/** @var RepositoryInterface */
private $creditMemoRepository;
private RepositoryInterface $creditMemoRepository;

public function __construct(
CustomerContextInterface $customerContext,
Expand Down
3 changes: 1 addition & 2 deletions src/Checker/OrderFullyRefundedTotalChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@

final class OrderFullyRefundedTotalChecker implements OrderFullyRefundedTotalCheckerInterface
{
/** @var OrderRefundedTotalProviderInterface */
private $orderRefundedTotalProvider;
private OrderRefundedTotalProviderInterface $orderRefundedTotalProvider;

public function __construct(OrderRefundedTotalProviderInterface $orderRefundedTotalProvider)
{
Expand Down
3 changes: 1 addition & 2 deletions src/Checker/OrderRefundingAvailabilityChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@

final class OrderRefundingAvailabilityChecker implements OrderRefundingAvailabilityCheckerInterface
{
/** @var OrderRepositoryInterface */
private $orderRepository;
private OrderRepositoryInterface $orderRepository;

public function __construct(OrderRepositoryInterface $orderRepository)
{
Expand Down
3 changes: 1 addition & 2 deletions src/Checker/OrderRefundsListAvailabilityChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@

final class OrderRefundsListAvailabilityChecker implements OrderRefundingAvailabilityCheckerInterface
{
/** @var OrderRepositoryInterface */
private $orderRepository;
private OrderRepositoryInterface $orderRepository;

public function __construct(OrderRepositoryInterface $orderRepository)
{
Expand Down
3 changes: 1 addition & 2 deletions src/Checker/UnitRefundingAvailabilityChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@

final class UnitRefundingAvailabilityChecker implements UnitRefundingAvailabilityCheckerInterface
{
/** @var RemainingTotalProviderInterface */
private $remainingTotalProvider;
private RemainingTotalProviderInterface $remainingTotalProvider;

public function __construct(RemainingTotalProviderInterface $remainingTotalProvider)
{
Expand Down
13 changes: 5 additions & 8 deletions src/Command/GenerateCreditMemo.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,17 @@

class GenerateCreditMemo
{
/** @var string */
private $orderNumber;
private string $orderNumber;

/** @var int */
private $total;
private int $total;

/** @var array|OrderItemUnitRefund[] */
private $units;
private array $units;

/** @var array|ShipmentRefund[] */
private $shipments;
private array $shipments;

/** @var string */
private $comment;
private string $comment;

public function __construct(string $orderNumber, int $total, array $units, array $shipments, string $comment)
{
Expand Down
13 changes: 5 additions & 8 deletions src/Command/RefundUnits.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,17 @@

class RefundUnits
{
/** @var string */
private $orderNumber;
private string $orderNumber;

/** @var array|OrderItemUnitRefund[] */
private $units;
private array $units;

/** @var array|ShipmentRefund[] */
private $shipments;
private array $shipments;

/** @var int */
private $paymentMethodId;
private int $paymentMethodId;

/** @var string */
private $comment;
private string $comment;

public function __construct(string $orderNumber, array $units, array $shipments, int $paymentMethodId, string $comment)
{
Expand Down
3 changes: 1 addition & 2 deletions src/Command/SendCreditMemo.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@

class SendCreditMemo
{
/** @var string */
private $number;
private string $number;

public function __construct(string $number)
{
Expand Down
12 changes: 4 additions & 8 deletions src/CommandHandler/GenerateCreditMemoHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,13 @@

final class GenerateCreditMemoHandler
{
/** @var CreditMemoGeneratorInterface */
private $creditMemoGenerator;
private CreditMemoGeneratorInterface $creditMemoGenerator;

/** @var ObjectManager */
private $creditMemoManager;
private ObjectManager $creditMemoManager;

/** @var MessageBusInterface */
private $eventBus;
private MessageBusInterface $eventBus;

/** @var OrderRepositoryInterface */
private $orderRepository;
private OrderRepositoryInterface $orderRepository;

public function __construct(
CreditMemoGeneratorInterface $creditMemoGenerator,
Expand Down
15 changes: 5 additions & 10 deletions src/CommandHandler/RefundUnitsHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,15 @@

final class RefundUnitsHandler
{
/** @var RefunderInterface */
private $orderUnitsRefunder;
private RefunderInterface $orderUnitsRefunder;

/** @var RefunderInterface */
private $orderShipmentsRefunder;
private RefunderInterface $orderShipmentsRefunder;

/** @var MessageBusInterface */
private $eventBus;
private MessageBusInterface $eventBus;

/** @var OrderRepositoryInterface */
private $orderRepository;
private OrderRepositoryInterface $orderRepository;

/** @var RefundUnitsCommandValidatorInterface */
private $refundUnitsCommandValidator;
private RefundUnitsCommandValidatorInterface $refundUnitsCommandValidator;

public function __construct(
RefunderInterface $orderUnitsRefunder,
Expand Down
6 changes: 2 additions & 4 deletions src/CommandHandler/SendCreditMemoHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@

final class SendCreditMemoHandler
{
/** @var RepositoryInterface */
private $creditMemoRepository;
private RepositoryInterface $creditMemoRepository;

/** @var CreditMemoEmailSenderInterface */
private $creditMemoEmailSender;
private CreditMemoEmailSenderInterface $creditMemoEmailSender;

public function __construct(
RepositoryInterface $creditMemoRepository,
Expand Down
6 changes: 2 additions & 4 deletions src/Converter/OrderItemUnitLineItemsConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@

final class OrderItemUnitLineItemsConverter implements LineItemsConverterInterface
{
/** @var RepositoryInterface */
private $orderItemUnitRepository;
private RepositoryInterface $orderItemUnitRepository;

/** @var TaxRateProviderInterface */
private $taxRateProvider;
private TaxRateProviderInterface $taxRateProvider;

public function __construct(RepositoryInterface $orderItemUnitRepository, TaxRateProviderInterface $taxRateProvider)
{
Expand Down
3 changes: 1 addition & 2 deletions src/Converter/RefundUnitsConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@

final class RefundUnitsConverter implements RefundUnitsConverterInterface
{
/** @var UnitRefundTotalCalculatorInterface */
private $unitRefundTotalCalculator;
private UnitRefundTotalCalculatorInterface $unitRefundTotalCalculator;

public function __construct(UnitRefundTotalCalculatorInterface $unitRefundTotalCalculator)
{
Expand Down
6 changes: 2 additions & 4 deletions src/Converter/ShipmentLineItemsConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@

final class ShipmentLineItemsConverter implements LineItemsConverterInterface
{
/** @var RepositoryInterface */
private $adjustmentRepository;
private RepositoryInterface $adjustmentRepository;

/** @var TaxRateProviderInterface */
private $taxRateProvider;
private TaxRateProviderInterface $taxRateProvider;

public function __construct(RepositoryInterface $adjustmentRepository, TaxRateProviderInterface $taxRateProvider)
{
Expand Down

0 comments on commit 79fede9

Please sign in to comment.