Skip to content

Commit

Permalink
Bump PHP to 7.4 and use its syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Zales0123 committed Sep 22, 2021
1 parent be88995 commit 3e1ca41
Show file tree
Hide file tree
Showing 67 changed files with 217 additions and 401 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,16 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ["8.0", "7.4", "7.3"]
php: ["8.0", "7.4"]
node: ["10.x"]
mysql: ["5.7", "8.0"]
symfony: ["^4.4", "^5.2"]
sylius: ["~1.8.0", "~1.9.0", "~1.10.0"]

exclude:
-
php: "7.3"
mysql: "8.0"
-
sylius: "~1.8.0"
symfony: "^5.2"
-
php: "7.3"
sylius: "~1.10.0"
-
php: "8.0"
sylius: "~1.8.0"
Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"description": "PayPal plugin for Sylius.",
"license": "MIT",
"require": {
"php": "^7.3 || ^8.0",
"php": "^7.4 || ^8.0",

"sylius/sylius": "^1.8",
"phpseclib/phpseclib": "^2.0",
Expand All @@ -27,7 +27,7 @@
"friends-of-behat/variadic-extension": "^1.3",
"friendsofsymfony/oauth-server-bundle": "^1.6 || >2.0.0-alpha.0 ^2.0@dev",
"phpspec/phpspec": "^6.1",
"phpstan/phpstan": "0.12.84",
"phpstan/phpstan": "0.12.98",
"phpstan/phpstan-doctrine": "0.12.33",
"phpstan/phpstan-webmozart-assert": "0.12.12",
"phpunit/phpunit": "^8.5",
Expand All @@ -39,7 +39,8 @@
"symfony/intl": "^4.4 || ^5.2",
"symfony/web-profiler-bundle": "^4.4 || ^5.2",
"symfony/web-server-bundle": "^4.4|^5.0",
"vimeo/psalm": "3.11.4"
"vimeo/psalm": "3.11.4",
"rector/rector": "^0.11.53"
},
"conflict": {
"symfony/doctrine-bridge": "4.4.16",
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);
};
3 changes: 1 addition & 2 deletions src/Api/AuthorizeClientApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@

final class AuthorizeClientApi implements AuthorizeClientApiInterface
{
/** @var PayPalClientInterface */
private $payPalClient;
private PayPalClientInterface $payPalClient;

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

final class CacheAuthorizeClientApi implements CacheAuthorizeClientApiInterface
{
/** @var ObjectManager */
private $payPalCredentialsManager;
private ObjectManager $payPalCredentialsManager;

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

/** @var AuthorizeClientApiInterface */
private $authorizeClientApi;
private AuthorizeClientApiInterface $authorizeClientApi;

/** @var UuidProviderInterface */
private $uuidProvider;
private UuidProviderInterface $uuidProvider;

public function __construct(
ObjectManager $payPalCredentialsManager,
Expand Down
3 changes: 1 addition & 2 deletions src/Api/CompleteOrderApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@

final class CompleteOrderApi implements CompleteOrderApiInterface
{
/** @var PayPalClientInterface */
private $client;
private PayPalClientInterface $client;

public function __construct(PayPalClientInterface $client)
{
Expand Down
9 changes: 3 additions & 6 deletions src/Api/CreateOrderApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,11 @@

final class CreateOrderApi implements CreateOrderApiInterface
{
/** @var PayPalClientInterface */
private $client;
private PayPalClientInterface $client;

/** @var PaymentReferenceNumberProviderInterface */
private $paymentReferenceNumberProvider;
private PaymentReferenceNumberProviderInterface $paymentReferenceNumberProvider;

/** @var PayPalItemDataProviderInterface */
private $payPalItemDataProvider;
private PayPalItemDataProviderInterface $payPalItemDataProvider;

public function __construct(
PayPalClientInterface $client,
Expand Down
3 changes: 1 addition & 2 deletions src/Api/GenericApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

final class GenericApi implements GenericApiInterface
{
/** @var ClientInterface */
private $client;
private ClientInterface $client;

public function __construct(ClientInterface $client)
{
Expand Down
3 changes: 1 addition & 2 deletions src/Api/IdentityApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@

final class IdentityApi implements IdentityApiInterface
{
/** @var PayPalClientInterface */
private $client;
private PayPalClientInterface $client;

public function __construct(PayPalClientInterface $client)
{
Expand Down
3 changes: 1 addition & 2 deletions src/Api/OrderDetailsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

final class OrderDetailsApi implements OrderDetailsApiInterface
{
/** @var PayPalClientInterface */
private $client;
private PayPalClientInterface $client;

public function __construct(PayPalClientInterface $client)
{
Expand Down
3 changes: 1 addition & 2 deletions src/Api/RefundPaymentApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@

final class RefundPaymentApi implements RefundPaymentApiInterface
{
/** @var PayPalClientInterface */
private $client;
private PayPalClientInterface $client;

public function __construct(PayPalClientInterface $client)
{
Expand Down
9 changes: 3 additions & 6 deletions src/Api/UpdateOrderApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,11 @@

final class UpdateOrderApi implements UpdateOrderApiInterface
{
/** @var PayPalClientInterface */
private $client;
private PayPalClientInterface $client;

/** @var PaymentReferenceNumberProviderInterface */
private $paymentReferenceNumberProvider;
private PaymentReferenceNumberProviderInterface $paymentReferenceNumberProvider;

/** @var PayPalItemDataProviderInterface */
private $payPalItemsDataProvider;
private PayPalItemDataProviderInterface $payPalItemsDataProvider;

public function __construct(
PayPalClientInterface $client,
Expand Down
6 changes: 2 additions & 4 deletions src/Api/WebhookApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@

final class WebhookApi implements WebhookApiInterface
{
/** @var ClientInterface */
private $client;
private ClientInterface $client;

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

public function __construct(ClientInterface $client, string $baseUrl)
{
Expand Down
6 changes: 2 additions & 4 deletions src/ApiPlatform/PayPalPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@
*/
final class PayPalPayment
{
/** @var RouterInterface */
private $router;
private RouterInterface $router;

/** @var AvailableCountriesProviderInterface */
private $availableCountriesProvider;
private AvailableCountriesProviderInterface $availableCountriesProvider;

public function __construct(RouterInterface $router, AvailableCountriesProviderInterface $availableCountriesProvider)
{
Expand Down
24 changes: 8 additions & 16 deletions src/Client/PayPalClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,21 @@

final class PayPalClient implements PayPalClientInterface
{
/** @var ClientInterface */
private $client;
private ClientInterface $client;

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

/** @var UuidProviderInterface */
private $uuidProvider;
private UuidProviderInterface $uuidProvider;

/** @var PayPalConfigurationProviderInterface */
private $payPalConfigurationProvider;
private PayPalConfigurationProviderInterface $payPalConfigurationProvider;

/** @var ChannelContextInterface */
private $channelContext;
private ChannelContextInterface $channelContext;

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

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

/** @var bool */
private $loggingLevelIncreased;
private bool $loggingLevelIncreased;

public function __construct(
ClientInterface $client,
Expand Down
15 changes: 5 additions & 10 deletions src/Command/CompletePaidPaymentsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,15 @@

final class CompletePaidPaymentsCommand extends Command
{
/** @var PaymentRepositoryInterface */
private $paymentRepository;
private PaymentRepositoryInterface $paymentRepository;

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

/** @var CacheAuthorizeClientApiInterface */
private $authorizeClientApi;
private CacheAuthorizeClientApiInterface $authorizeClientApi;

/** @var OrderDetailsApiInterface */
private $orderDetailsApi;
private OrderDetailsApiInterface $orderDetailsApi;

/** @var FactoryInterface */
private $stateMachineFactory;
private FactoryInterface $stateMachineFactory;

public function __construct(
PaymentRepositoryInterface $paymentRepository,
Expand Down
6 changes: 2 additions & 4 deletions src/Controller/CancelPayPalCheckoutPaymentAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@

final class CancelPayPalCheckoutPaymentAction
{
/** @var PaymentProviderInterface */
private $paymentProvider;
private PaymentProviderInterface $paymentProvider;

/** @var PaymentStateManagerInterface */
private $paymentStateManager;
private PaymentStateManagerInterface $paymentStateManager;

public function __construct(
PaymentProviderInterface $paymentProvider,
Expand Down
9 changes: 3 additions & 6 deletions src/Controller/CancelPayPalOrderAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,11 @@

final class CancelPayPalOrderAction
{
/** @var PaymentProviderInterface */
private $paymentProvider;
private PaymentProviderInterface $paymentProvider;

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

/** @var FlashBag */
private $flashBag;
private FlashBag $flashBag;

public function __construct(
PaymentProviderInterface $paymentProvider,
Expand Down
15 changes: 5 additions & 10 deletions src/Controller/CancelPayPalPaymentAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,15 @@

final class CancelPayPalPaymentAction
{
/** @var PaymentProviderInterface */
private $paymentProvider;
private PaymentProviderInterface $paymentProvider;

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

/** @var FlashBag */
private $flashBag;
private FlashBag $flashBag;

/** @var FactoryInterface */
private $stateMachineFactory;
private FactoryInterface $stateMachineFactory;

/** @var OrderProcessorInterface */
private $orderPaymentProcessor;
private OrderProcessorInterface $orderPaymentProcessor;

public function __construct(
PaymentProviderInterface $paymentProvider,
Expand Down
9 changes: 3 additions & 6 deletions src/Controller/CompletePayPalOrderAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,11 @@

final class CompletePayPalOrderAction
{
/** @var PaymentStateManagerInterface */
private $paymentStateManager;
private PaymentStateManagerInterface $paymentStateManager;

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

/** @var OrderProviderInterface */
private $orderProvider;
private OrderProviderInterface $orderProvider;

public function __construct(
PaymentStateManagerInterface $paymentStateManager,
Expand Down
15 changes: 5 additions & 10 deletions src/Controller/CompletePayPalOrderFromPaymentPageAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,15 @@

final class CompletePayPalOrderFromPaymentPageAction
{
/** @var PaymentStateManagerInterface */
private $paymentStateManager;
private PaymentStateManagerInterface $paymentStateManager;

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

/** @var OrderProviderInterface */
private $orderProvider;
private OrderProviderInterface $orderProvider;

/** @var FactoryInterface */
private $stateMachine;
private FactoryInterface $stateMachine;

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

public function __construct(
PaymentStateManagerInterface $paymentStateManager,
Expand Down
Loading

0 comments on commit 3e1ca41

Please sign in to comment.