Skip to content

Commit

Permalink
PHP 7.4 syntax in bundles vol.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Zales0123 committed Sep 17, 2021
1 parent 069cdfd commit 676df96
Show file tree
Hide file tree
Showing 161 changed files with 365 additions and 698 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,25 @@
*/
final class SwaggerUiAction
{
private $resourceNameCollectionFactory;
private ResourceNameCollectionFactoryInterface $resourceNameCollectionFactory;

private $resourceMetadataFactory;
private ResourceMetadataFactoryInterface $resourceMetadataFactory;

private $normalizer;
private NormalizerInterface $normalizer;

private $twig;
private TwigEnvironment $twig;

private $urlGenerator;
private UrlGeneratorInterface $urlGenerator;

private $title;
private string $title;

private $description;
private string $description;

private $version;
private string $version;

private $showWebby;
private bool $showWebby;

private $formats;
private ?array $formats;

private $oauthEnabled;

Expand All @@ -72,17 +72,17 @@ final class SwaggerUiAction

private $formatsProvider;

private $swaggerUiEnabled;
private bool $swaggerUiEnabled;

private $reDocEnabled;
private bool $reDocEnabled;

private $graphqlEnabled;
private bool $graphqlEnabled;

private $graphiQlEnabled;
private bool $graphiQlEnabled;

private $graphQlPlaygroundEnabled;
private bool $graphQlPlaygroundEnabled;

private $swaggerVersions;
private array $swaggerVersions;

/**
* @param int[] $swaggerVersions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ final class CachedRouteNameResolver implements RouteNameResolverInterface
{
use CachedTrait;

/** @var RouteNameResolverInterface */
private $decorated;
private RouteNameResolverInterface $decorated;

/** @var PathPrefixProviderInterface */
private $pathPrefixProvider;
private PathPrefixProviderInterface $pathPrefixProvider;

public function __construct(
CacheItemPoolInterface $cacheItemPool,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@
*/
final class RouteNameResolver implements RouteNameResolverInterface
{
/** @var RouterInterface */
private $router;
private RouterInterface $router;

/** @var PathPrefixProviderInterface */
private $pathPrefixProvider;
private PathPrefixProviderInterface $pathPrefixProvider;

public function __construct(RouterInterface $router, PathPrefixProviderInterface $pathPrefixProvider)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
/** @experimental */
final class ArchivingShippingMethodApplicator implements ArchivingShippingMethodApplicatorInterface
{
/** @var DateTimeProvider */
private $calendar;
private DateTimeProvider $calendar;

public function __construct(DateTimeProvider $calendar)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
/** @experimental */
final class OrderStateMachineTransitionApplicator implements OrderStateMachineTransitionApplicatorInterface
{
/** @var StateMachineFactoryInterface */
private $stateMachineFactory;
private StateMachineFactoryInterface $stateMachineFactory;

public function __construct(StateMachineFactoryInterface $stateMachineFactory)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
/** @experimental */
final class PaymentStateMachineTransitionApplicator implements PaymentStateMachineTransitionApplicatorInterface
{
/** @var StateMachineFactoryInterface */
private $stateMachineFactory;
private StateMachineFactoryInterface $stateMachineFactory;

public function __construct(StateMachineFactoryInterface $stateMachineFactory)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
/** @experimental */
final class ProductReviewStateMachineTransitionApplicator implements ProductReviewStateMachineTransitionApplicatorInterface
{
/** @var StateMachineFactoryInterface */
private $stateMachineFactory;
private StateMachineFactoryInterface $stateMachineFactory;

public function __construct(StateMachineFactoryInterface $stateMachineFactory)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@
/** @experimental */
final class ShipmentStateMachineTransitionApplicator implements ShipmentStateMachineTransitionApplicatorInterface
{
/** @var StateMachineFactoryInterface */
private $stateMachineFactory;
private StateMachineFactoryInterface $stateMachineFactory;

/** @var EventDispatcherInterface */
private $eventDispatcher;
private EventDispatcherInterface $eventDispatcher;

public function __construct(
StateMachineFactoryInterface $stateMachineFactory,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
/** @experimental */
final class ApiScenarioEventDispatchingScenarioTester implements ScenarioTester
{
/** @var ScenarioTester */
private $baseTester;
private ScenarioTester $baseTester;

public function __construct(ScenarioTester $baseTester)
{
Expand Down
6 changes: 2 additions & 4 deletions src/Sylius/Bundle/ApiBundle/Changer/PaymentMethodChanger.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@
/** @experimental */
final class PaymentMethodChanger implements PaymentMethodChangerInterface
{
/** @var PaymentRepositoryInterface */
private $paymentRepository;
private PaymentRepositoryInterface $paymentRepository;

/** @var PaymentMethodRepositoryInterface */
private $paymentMethodRepository;
private PaymentMethodRepositoryInterface $paymentMethodRepository;

public function __construct(
PaymentRepositoryInterface $paymentRepository,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,17 @@
/** @experimental */
class ChangePaymentMethod implements OrderTokenValueAwareInterface, SubresourceIdAwareInterface
{
/** @var string|null */
public $orderTokenValue;
public ?string $orderTokenValue = null;

/**
* @psalm-immutable
*
* @var string
*/
public $paymentId;
public ?string $paymentId = null;

/**
* @psalm-immutable
*
* @var string
*/
public $paymentMethodCode;
public string $paymentMethodCode;

public function __construct(string $paymentMethodCode)
{
Expand Down
15 changes: 5 additions & 10 deletions src/Sylius/Bundle/ApiBundle/Command/AddProductReview.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,29 @@
class AddProductReview implements CommandAwareDataTransformerInterface
{
/**
* @var string
* @psalm-immutable
*/
public $title;
public ?string $title;

/**
* @var int
* @psalm-immutable
*/
public $rating;
public ?int $rating;

/**
* @var string
* @psalm-immutable
*/
public $comment;
public ?string $comment;

/**
* @var string
* @psalm-immutable
*/
public $productCode;
public string $productCode;

/**
* @var string|null
* @psalm-immutable
*/
public $email;
public ?string $email;

public function __construct(
?string $title,
Expand Down
6 changes: 2 additions & 4 deletions src/Sylius/Bundle/ApiBundle/Command/BlameCart.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,14 @@
class BlameCart
{
/**
* @var string
* @psalm-immutable
*/
public $shopUserEmail;
public string $shopUserEmail;

/**
* @var string
* @psalm-immutable
*/
public $orderTokenValue;
public string $orderTokenValue;

public function __construct(string $shopUserEmail, string $orderTokenValue)
{
Expand Down
9 changes: 3 additions & 6 deletions src/Sylius/Bundle/ApiBundle/Command/Cart/AddItemToCart.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,17 @@
/** @experimental */
class AddItemToCart implements OrderTokenValueAwareInterface
{
/** @var string|null */
public $orderTokenValue;
public ?string $orderTokenValue = null;

/**
* @var string
* @psalm-immutable
*/
public $productVariantCode;
public string $productVariantCode;

/**
* @var int
* @psalm-immutable
*/
public $quantity;
public int $quantity;

public function __construct(string $productVariantCode, int $quantity)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@
/** @experimental */
class ApplyCouponToCart implements OrderTokenValueAwareInterface
{
/** @var string|null */
public $orderTokenValue;
public ?string $orderTokenValue = null;

/** @var string|null */
public $couponCode;
public ?string $couponCode;

public function __construct(?string $couponCode)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,14 @@
/** @experimental */
class ChangeItemQuantityInCart implements OrderTokenValueAwareInterface, SubresourceIdAwareInterface
{
/** @var string|null */
public $orderTokenValue;
public ?string $orderTokenValue = null;

/** @var mixed|null */
public $orderItemId;
public ?string $orderItemId = null;

/**
* @var int
* @psalm-immutable
*/
public $quantity;
public int $quantity;

public function __construct(int $quantity)
{
Expand Down
10 changes: 4 additions & 6 deletions src/Sylius/Bundle/ApiBundle/Command/Cart/PickupCart.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,16 @@
/** @experimental */
class PickupCart implements ChannelCodeAwareInterface
{
/** @var string|null
/**
* @psalm-immutable */
public $tokenValue;
public ?string $tokenValue;

/**
* @var string|null
* @psalm-immutable
*/
public $localeCode;
public ?string $localeCode;

/** @var string|null */
private $channelCode;
private ?string $channelCode = null;

public function __construct(?string $tokenValue = null, ?string $localeCode = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@
/** @experimental */
class RemoveItemFromCart implements OrderTokenValueAwareInterface
{
/** @var string|null */
public $orderTokenValue;
public ?string $orderTokenValue;

/**
* @var string
* @psalm-immutable
*/
public $itemId;
public string $itemId;

public function __construct(?string $orderTokenValue, string $itemId)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,19 @@ class ChangeShopUserPassword implements ShopUserIdAwareInterface
public $shopUserId;

/**
* @var string|null
* @psalm-immutable
*/
public $newPassword;
public ?string $newPassword;

/**
* @var string|null
* @psalm-immutable
*/
public $confirmNewPassword;
public ?string $confirmNewPassword;

/**
* @var string|null
* @psalm-immutable
*/
public $currentPassword;
public ?string $currentPassword;

public function __construct(?string $newPassword, ?string $confirmNewPassword, ?string $currentPassword)
{
Expand Down
Loading

0 comments on commit 676df96

Please sign in to comment.