diff --git a/composer.json b/composer.json index f104de61cde..738c95ab198 100644 --- a/composer.json +++ b/composer.json @@ -185,11 +185,12 @@ "mikey179/vfsstream": "^1.6", "mockery/mockery": "^1.4", "phpspec/phpspec": "^7.0", - "phpstan/phpstan": "0.12.82", + "phpstan/phpstan": "0.12.96", "phpstan/phpstan-doctrine": "0.12.33", "phpunit/phpunit": "^8.5", "psalm/plugin-mockery": "0.7.0", "psr/event-dispatcher": "^1.0", + "rector/rector": "^0.11.51", "stripe/stripe-php": "^6.43", "sylius-labs/coding-standard": "^4.0", "symfony/browser-kit": "^4.4 || ^5.2", diff --git a/rector.php b/rector.php new file mode 100644 index 00000000000..6566b71df8f --- /dev/null +++ b/rector.php @@ -0,0 +1,18 @@ +parameters(); + $parameters->set(Option::AUTO_IMPORT_NAMES, true); + $parameters->set(Option::IMPORT_SHORT_CLASSES, false); + + $services = $containerConfigurator->services(); + $services->set(TypedPropertyRector::class); +}; diff --git a/src/Sylius/Component/Addressing/Factory/ZoneFactory.php b/src/Sylius/Component/Addressing/Factory/ZoneFactory.php index bac738003c4..7717372d707 100644 --- a/src/Sylius/Component/Addressing/Factory/ZoneFactory.php +++ b/src/Sylius/Component/Addressing/Factory/ZoneFactory.php @@ -19,11 +19,9 @@ final class ZoneFactory implements ZoneFactoryInterface { - /** @var FactoryInterface */ - private $factory; + private FactoryInterface $factory; - /** @var FactoryInterface */ - private $zoneMemberFactory; + private FactoryInterface $zoneMemberFactory; public function __construct(FactoryInterface $factory, FactoryInterface $zoneMemberFactory) { diff --git a/src/Sylius/Component/Addressing/Matcher/ZoneMatcher.php b/src/Sylius/Component/Addressing/Matcher/ZoneMatcher.php index 361b0edba2d..943f311e3f4 100644 --- a/src/Sylius/Component/Addressing/Matcher/ZoneMatcher.php +++ b/src/Sylius/Component/Addressing/Matcher/ZoneMatcher.php @@ -21,8 +21,7 @@ final class ZoneMatcher implements ZoneMatcherInterface { - /** @var RepositoryInterface */ - private $zoneRepository; + private RepositoryInterface $zoneRepository; /** * @var array diff --git a/src/Sylius/Component/Addressing/Model/Address.php b/src/Sylius/Component/Addressing/Model/Address.php index 89d46c54284..1eb4eb52450 100644 --- a/src/Sylius/Component/Addressing/Model/Address.php +++ b/src/Sylius/Component/Addressing/Model/Address.php @@ -22,35 +22,25 @@ class Address implements AddressInterface /** @var mixed */ protected $id; - /** @var string|null */ - protected $firstName; + protected ?string $firstName = null; - /** @var string|null */ - protected $lastName; + protected ?string $lastName = null; - /** @var string|null */ - protected $phoneNumber; + protected ?string $phoneNumber = null; - /** @var string|null */ - protected $company; + protected ?string $company = null; - /** @var string|null */ - protected $countryCode; + protected ?string $countryCode = null; - /** @var string|null */ - protected $provinceCode; + protected ?string $provinceCode = null; - /** @var string|null */ - protected $provinceName; + protected ?string $provinceName = null; - /** @var string|null */ - protected $street; + protected ?string $street = null; - /** @var string|null */ - protected $city; + protected ?string $city = null; - /** @var string|null */ - protected $postcode; + protected ?string $postcode = null; public function __construct() { diff --git a/src/Sylius/Component/Addressing/Model/Country.php b/src/Sylius/Component/Addressing/Model/Country.php index 6bbb88baefa..79fac6d37cd 100644 --- a/src/Sylius/Component/Addressing/Model/Country.php +++ b/src/Sylius/Component/Addressing/Model/Country.php @@ -27,17 +27,15 @@ class Country implements CountryInterface /** * Country code ISO 3166-1 alpha-2. - * - * @var string|null */ - protected $code; + protected ?string $code = null; /** * @var Collection|ProvinceInterface[] * * @psalm-var Collection */ - protected $provinces; + protected Collection $provinces; public function __construct() { diff --git a/src/Sylius/Component/Addressing/Model/Province.php b/src/Sylius/Component/Addressing/Model/Province.php index f66827dedb4..da4d2aab349 100644 --- a/src/Sylius/Component/Addressing/Model/Province.php +++ b/src/Sylius/Component/Addressing/Model/Province.php @@ -18,17 +18,13 @@ class Province implements ProvinceInterface /** @var mixed */ protected $id; - /** @var string|null */ - protected $code; + protected ?string $code = null; - /** @var string|null */ - protected $name; + protected ?string $name = null; - /** @var string|null */ - protected $abbreviation; + protected ?string $abbreviation = null; - /** @var CountryInterface|null */ - protected $country; + protected ?CountryInterface $country = null; public function __toString(): string { diff --git a/src/Sylius/Component/Addressing/Model/Zone.php b/src/Sylius/Component/Addressing/Model/Zone.php index a754daf7d82..2190ecac025 100644 --- a/src/Sylius/Component/Addressing/Model/Zone.php +++ b/src/Sylius/Component/Addressing/Model/Zone.php @@ -21,24 +21,20 @@ class Zone implements ZoneInterface /** @var mixed */ protected $id; - /** @var string|null */ - protected $code; + protected ?string $code = null; - /** @var string|null */ - protected $name; + protected ?string $name = null; - /** @var string|null */ - protected $type; + protected ?string $type = null; - /** @var string|null */ - protected $scope = Scope::ALL; + protected ?string $scope = Scope::ALL; /** * @var Collection|ZoneMemberInterface[] * * @psalm-var Collection */ - protected $members; + protected Collection $members; public function __construct() { diff --git a/src/Sylius/Component/Addressing/Model/ZoneMember.php b/src/Sylius/Component/Addressing/Model/ZoneMember.php index c43c16c077c..4e7ba61a5a3 100644 --- a/src/Sylius/Component/Addressing/Model/ZoneMember.php +++ b/src/Sylius/Component/Addressing/Model/ZoneMember.php @@ -18,11 +18,9 @@ class ZoneMember implements ZoneMemberInterface /** @var mixed */ protected $id; - /** @var string|null */ - protected $code; + protected ?string $code = null; - /** @var ZoneInterface|null */ - protected $belongsTo; + protected ?ZoneInterface $belongsTo = null; public function getId() { diff --git a/src/Sylius/Component/Addressing/Provider/ProvinceNamingProvider.php b/src/Sylius/Component/Addressing/Provider/ProvinceNamingProvider.php index 2f3c88045c6..baf67e3e630 100644 --- a/src/Sylius/Component/Addressing/Provider/ProvinceNamingProvider.php +++ b/src/Sylius/Component/Addressing/Provider/ProvinceNamingProvider.php @@ -20,8 +20,7 @@ class ProvinceNamingProvider implements ProvinceNamingProviderInterface { - /** @var RepositoryInterface */ - private $provinceRepository; + private RepositoryInterface $provinceRepository; public function __construct(RepositoryInterface $provinceRepository) { diff --git a/src/Sylius/Component/Attribute/Factory/AttributeFactory.php b/src/Sylius/Component/Attribute/Factory/AttributeFactory.php index 9e0fff7e939..834c7b52641 100644 --- a/src/Sylius/Component/Attribute/Factory/AttributeFactory.php +++ b/src/Sylius/Component/Attribute/Factory/AttributeFactory.php @@ -20,11 +20,9 @@ final class AttributeFactory implements AttributeFactoryInterface { - /** @var FactoryInterface */ - private $factory; + private FactoryInterface $factory; - /** @var ServiceRegistryInterface */ - private $attributeTypesRegistry; + private ServiceRegistryInterface $attributeTypesRegistry; public function __construct(FactoryInterface $factory, ServiceRegistryInterface $attributeTypesRegistry) { diff --git a/src/Sylius/Component/Attribute/Model/Attribute.php b/src/Sylius/Component/Attribute/Model/Attribute.php index 98c037818b7..96ce72c2c2c 100644 --- a/src/Sylius/Component/Attribute/Model/Attribute.php +++ b/src/Sylius/Component/Attribute/Model/Attribute.php @@ -29,23 +29,17 @@ class Attribute implements AttributeInterface /** @var mixed */ protected $id; - /** @var string */ - protected $code; + protected ?string $code = null; - /** @var string */ - protected $type = TextAttributeType::TYPE; + protected ?string $type = TextAttributeType::TYPE; - /** @var array */ - protected $configuration = []; + protected array $configuration = []; - /** @var string */ - protected $storageType; + protected ?string $storageType = null; - /** @var int */ - protected $position; + protected ?int $position = null; - /** @var bool */ - protected $translatable = true; + protected bool $translatable = true; public function __construct() { diff --git a/src/Sylius/Component/Attribute/Model/AttributeTranslation.php b/src/Sylius/Component/Attribute/Model/AttributeTranslation.php index ec56a8f785a..4fc1c7771f4 100644 --- a/src/Sylius/Component/Attribute/Model/AttributeTranslation.php +++ b/src/Sylius/Component/Attribute/Model/AttributeTranslation.php @@ -20,8 +20,7 @@ class AttributeTranslation extends AbstractTranslation implements AttributeTrans /** @var mixed */ protected $id; - /** @var string|null */ - protected $name; + protected ?string $name = null; public function getId() { diff --git a/src/Sylius/Component/Attribute/Model/AttributeValue.php b/src/Sylius/Component/Attribute/Model/AttributeValue.php index 609105922b2..129e7a065f6 100644 --- a/src/Sylius/Component/Attribute/Model/AttributeValue.php +++ b/src/Sylius/Component/Attribute/Model/AttributeValue.php @@ -18,35 +18,25 @@ class AttributeValue implements AttributeValueInterface /** @var mixed */ protected $id; - /** @var AttributeSubjectInterface|null */ - protected $subject; + protected ?AttributeSubjectInterface $subject = null; - /** @var AttributeInterface|null */ - protected $attribute; + protected ?AttributeInterface $attribute = null; - /** @var string|null */ - protected $localeCode; + protected ?string $localeCode = null; - /** @var string|null */ - private $text; + private ?string $text = null; - /** @var bool|null */ - private $boolean; + private ?bool $boolean = null; - /** @var int|null */ - private $integer; + private ?int $integer = null; - /** @var float|null */ - private $float; + private ?float $float = null; - /** @var \DateTimeInterface|null */ - private $datetime; + private ?\DateTimeInterface $datetime = null; - /** @var \DateTimeInterface|null */ - private $date; + private ?\DateTimeInterface $date = null; - /** @var array|null */ - private $json; + private ?array $json = null; public function getId() { diff --git a/src/Sylius/Component/Channel/Context/CachedPerRequestChannelContext.php b/src/Sylius/Component/Channel/Context/CachedPerRequestChannelContext.php index 10433af1192..636dbfe3e6c 100644 --- a/src/Sylius/Component/Channel/Context/CachedPerRequestChannelContext.php +++ b/src/Sylius/Component/Channel/Context/CachedPerRequestChannelContext.php @@ -19,17 +19,13 @@ final class CachedPerRequestChannelContext implements ChannelContextInterface { - /** @var ChannelContextInterface */ - private $decoratedChannelContext; + private ChannelContextInterface $decoratedChannelContext; - /** @var RequestStack */ - private $requestStack; + private RequestStack $requestStack; - /** @var \SplObjectStorage */ - private $requestToChannelMap; + private \SplObjectStorage $requestToChannelMap; - /** @var \SplObjectStorage */ - private $requestToExceptionMap; + private \SplObjectStorage $requestToExceptionMap; public function __construct(ChannelContextInterface $decoratedChannelContext, RequestStack $requestStack) { diff --git a/src/Sylius/Component/Channel/Context/CompositeChannelContext.php b/src/Sylius/Component/Channel/Context/CompositeChannelContext.php index 610f6a52391..7c9cd4a262f 100644 --- a/src/Sylius/Component/Channel/Context/CompositeChannelContext.php +++ b/src/Sylius/Component/Channel/Context/CompositeChannelContext.php @@ -23,7 +23,7 @@ final class CompositeChannelContext implements ChannelContextInterface * * @psalm-var PriorityQueue */ - private $channelContexts; + private PriorityQueue $channelContexts; public function __construct() { diff --git a/src/Sylius/Component/Channel/Context/RequestBased/ChannelContext.php b/src/Sylius/Component/Channel/Context/RequestBased/ChannelContext.php index 6d8e369f8d1..1529657a1e8 100644 --- a/src/Sylius/Component/Channel/Context/RequestBased/ChannelContext.php +++ b/src/Sylius/Component/Channel/Context/RequestBased/ChannelContext.php @@ -21,11 +21,9 @@ final class ChannelContext implements ChannelContextInterface { - /** @var RequestResolverInterface */ - private $requestResolver; + private RequestResolverInterface $requestResolver; - /** @var RequestStack */ - private $requestStack; + private RequestStack $requestStack; public function __construct(RequestResolverInterface $requestResolver, RequestStack $requestStack) { diff --git a/src/Sylius/Component/Channel/Context/RequestBased/CompositeRequestResolver.php b/src/Sylius/Component/Channel/Context/RequestBased/CompositeRequestResolver.php index 2d53031568f..6944384df2f 100644 --- a/src/Sylius/Component/Channel/Context/RequestBased/CompositeRequestResolver.php +++ b/src/Sylius/Component/Channel/Context/RequestBased/CompositeRequestResolver.php @@ -24,7 +24,7 @@ final class CompositeRequestResolver implements RequestResolverInterface * * @psalm-var PriorityQueue */ - private $requestResolvers; + private PriorityQueue $requestResolvers; public function __construct() { diff --git a/src/Sylius/Component/Channel/Context/RequestBased/HostnameBasedRequestResolver.php b/src/Sylius/Component/Channel/Context/RequestBased/HostnameBasedRequestResolver.php index 8f77ba7b8f3..47356dbfcd6 100644 --- a/src/Sylius/Component/Channel/Context/RequestBased/HostnameBasedRequestResolver.php +++ b/src/Sylius/Component/Channel/Context/RequestBased/HostnameBasedRequestResolver.php @@ -19,8 +19,7 @@ final class HostnameBasedRequestResolver implements RequestResolverInterface { - /** @var ChannelRepositoryInterface */ - private $channelRepository; + private ChannelRepositoryInterface $channelRepository; public function __construct(ChannelRepositoryInterface $channelRepository) { diff --git a/src/Sylius/Component/Channel/Context/SingleChannelContext.php b/src/Sylius/Component/Channel/Context/SingleChannelContext.php index 0d11d334ee2..f172766fe70 100644 --- a/src/Sylius/Component/Channel/Context/SingleChannelContext.php +++ b/src/Sylius/Component/Channel/Context/SingleChannelContext.php @@ -18,8 +18,7 @@ final class SingleChannelContext implements ChannelContextInterface { - /** @var ChannelRepositoryInterface */ - private $channelRepository; + private ChannelRepositoryInterface $channelRepository; public function __construct(ChannelRepositoryInterface $channelRepository) { diff --git a/src/Sylius/Component/Channel/Factory/ChannelFactory.php b/src/Sylius/Component/Channel/Factory/ChannelFactory.php index 69172f2d0fa..625a53b2e44 100644 --- a/src/Sylius/Component/Channel/Factory/ChannelFactory.php +++ b/src/Sylius/Component/Channel/Factory/ChannelFactory.php @@ -18,8 +18,7 @@ final class ChannelFactory implements ChannelFactoryInterface { - /** @var FactoryInterface */ - private $defaultFactory; + private FactoryInterface $defaultFactory; public function __construct(FactoryInterface $defaultFactory) { diff --git a/src/Sylius/Component/Channel/Model/Channel.php b/src/Sylius/Component/Channel/Model/Channel.php index da6311037c1..d706207c4cc 100644 --- a/src/Sylius/Component/Channel/Model/Channel.php +++ b/src/Sylius/Component/Channel/Model/Channel.php @@ -20,23 +20,18 @@ class Channel implements ChannelInterface { use TimestampableTrait, ToggleableTrait; - /** @var mixed|null */ + /** @var mixed */ protected $id; - /** @var string|null */ - protected $code; + protected ?string $code = null; - /** @var string|null */ - protected $name; + protected ?string $name = null; - /** @var string|null */ - protected $description; + protected ?string $description = null; - /** @var string|null */ - protected $hostname; + protected ?string $hostname = null; - /** @var string|null */ - protected $color; + protected ?string $color = null; public function __construct() { diff --git a/src/Sylius/Component/Channel/spec/Context/CachedPerRequestChannelContextSpec.php b/src/Sylius/Component/Channel/spec/Context/CachedPerRequestChannelContextSpec.php index 96b53bcafb8..6d66236caa5 100644 --- a/src/Sylius/Component/Channel/spec/Context/CachedPerRequestChannelContextSpec.php +++ b/src/Sylius/Component/Channel/spec/Context/CachedPerRequestChannelContextSpec.php @@ -116,11 +116,9 @@ function it_does_not_cache_channel_not_found_exceptions_for_null_master_requests $decoratedChannelContext ->getChannel() ->will(new class($channel->getWrappedObject()) { - /** @var int */ - private $counter = 0; + private int $counter = 0; - /** @var ChannelInterface */ - private $channel; + private ChannelInterface $channel; public function __construct(ChannelInterface $channel) { diff --git a/src/Sylius/Component/Core/Cart/Context/ShopBasedCartContext.php b/src/Sylius/Component/Core/Cart/Context/ShopBasedCartContext.php index c76adf55863..9721576b4fe 100644 --- a/src/Sylius/Component/Core/Cart/Context/ShopBasedCartContext.php +++ b/src/Sylius/Component/Core/Cart/Context/ShopBasedCartContext.php @@ -27,14 +27,11 @@ final class ShopBasedCartContext implements CartContextInterface { - /** @var CartContextInterface */ - private $cartContext; + private CartContextInterface $cartContext; - /** @var ShopperContextInterface */ - private $shopperContext; + private ShopperContextInterface $shopperContext; - /** @var OrderInterface|null */ - private $cart; + private ?OrderInterface $cart = null; public function __construct(CartContextInterface $cartContext, ShopperContextInterface $shopperContext) { diff --git a/src/Sylius/Component/Core/Cart/Modifier/LimitingOrderItemQuantityModifier.php b/src/Sylius/Component/Core/Cart/Modifier/LimitingOrderItemQuantityModifier.php index dc3ee4f9bfe..e01d53c2b76 100644 --- a/src/Sylius/Component/Core/Cart/Modifier/LimitingOrderItemQuantityModifier.php +++ b/src/Sylius/Component/Core/Cart/Modifier/LimitingOrderItemQuantityModifier.php @@ -18,11 +18,9 @@ final class LimitingOrderItemQuantityModifier implements OrderItemQuantityModifierInterface { - /** @var OrderItemQuantityModifierInterface */ - private $decoratedOrderItemQuantityModifier; + private OrderItemQuantityModifierInterface $decoratedOrderItemQuantityModifier; - /** @var int */ - private $limit; + private int $limit; public function __construct(OrderItemQuantityModifierInterface $decoratedOrderItemQuantityModifier, int $limit) { diff --git a/src/Sylius/Component/Core/Checker/OrderPaymentMethodSelectionRequirementChecker.php b/src/Sylius/Component/Core/Checker/OrderPaymentMethodSelectionRequirementChecker.php index 8ecab5f1a22..4febcf5975c 100644 --- a/src/Sylius/Component/Core/Checker/OrderPaymentMethodSelectionRequirementChecker.php +++ b/src/Sylius/Component/Core/Checker/OrderPaymentMethodSelectionRequirementChecker.php @@ -18,8 +18,7 @@ final class OrderPaymentMethodSelectionRequirementChecker implements OrderPaymentMethodSelectionRequirementCheckerInterface { - /** @var PaymentMethodsResolverInterface */ - private $paymentMethodsResolver; + private PaymentMethodsResolverInterface $paymentMethodsResolver; public function __construct(PaymentMethodsResolverInterface $paymentMethodsResolver) { diff --git a/src/Sylius/Component/Core/Checker/OrderShippingMethodSelectionRequirementChecker.php b/src/Sylius/Component/Core/Checker/OrderShippingMethodSelectionRequirementChecker.php index 5b590a889b3..77bf23be96b 100644 --- a/src/Sylius/Component/Core/Checker/OrderShippingMethodSelectionRequirementChecker.php +++ b/src/Sylius/Component/Core/Checker/OrderShippingMethodSelectionRequirementChecker.php @@ -19,8 +19,7 @@ final class OrderShippingMethodSelectionRequirementChecker implements OrderShippingMethodSelectionRequirementCheckerInterface { - /** @var ShippingMethodsResolverInterface */ - private $shippingMethodsResolver; + private ShippingMethodsResolverInterface $shippingMethodsResolver; public function __construct(ShippingMethodsResolverInterface $shippingMethodsResolver) { diff --git a/src/Sylius/Component/Core/Context/ShopperContext.php b/src/Sylius/Component/Core/Context/ShopperContext.php index 88dbeaa6292..724203651d5 100644 --- a/src/Sylius/Component/Core/Context/ShopperContext.php +++ b/src/Sylius/Component/Core/Context/ShopperContext.php @@ -25,17 +25,13 @@ */ /* final */ class ShopperContext implements ShopperContextInterface { - /** @var ChannelContextInterface */ - private $channelContext; + private ChannelContextInterface $channelContext; - /** @var CurrencyContextInterface */ - private $currencyContext; + private CurrencyContextInterface $currencyContext; - /** @var LocaleContextInterface */ - private $localeContext; + private LocaleContextInterface $localeContext; - /** @var CustomerContextInterface */ - private $customerContext; + private CustomerContextInterface $customerContext; public function __construct( ChannelContextInterface $channelContext, diff --git a/src/Sylius/Component/Core/Currency/Context/ChannelAwareCurrencyContext.php b/src/Sylius/Component/Core/Currency/Context/ChannelAwareCurrencyContext.php index 13b4a841dde..1abcf7baaf2 100644 --- a/src/Sylius/Component/Core/Currency/Context/ChannelAwareCurrencyContext.php +++ b/src/Sylius/Component/Core/Currency/Context/ChannelAwareCurrencyContext.php @@ -21,11 +21,9 @@ final class ChannelAwareCurrencyContext implements CurrencyContextInterface { - /** @var CurrencyContextInterface */ - private $currencyContext; + private CurrencyContextInterface $currencyContext; - /** @var ChannelContextInterface */ - private $channelContext; + private ChannelContextInterface $channelContext; public function __construct(CurrencyContextInterface $currencyContext, ChannelContextInterface $channelContext) { diff --git a/src/Sylius/Component/Core/Currency/Context/StorageBasedCurrencyContext.php b/src/Sylius/Component/Core/Currency/Context/StorageBasedCurrencyContext.php index 150dec74589..16b07c016b6 100644 --- a/src/Sylius/Component/Core/Currency/Context/StorageBasedCurrencyContext.php +++ b/src/Sylius/Component/Core/Currency/Context/StorageBasedCurrencyContext.php @@ -21,11 +21,9 @@ final class StorageBasedCurrencyContext implements CurrencyContextInterface { - /** @var ChannelContextInterface */ - private $channelContext; + private ChannelContextInterface $channelContext; - /** @var CurrencyStorageInterface */ - private $currencyStorage; + private CurrencyStorageInterface $currencyStorage; public function __construct(ChannelContextInterface $channelContext, CurrencyStorageInterface $currencyStorage) { diff --git a/src/Sylius/Component/Core/Currency/CurrencyStorage.php b/src/Sylius/Component/Core/Currency/CurrencyStorage.php index b8597aae57c..5356c1adeea 100644 --- a/src/Sylius/Component/Core/Currency/CurrencyStorage.php +++ b/src/Sylius/Component/Core/Currency/CurrencyStorage.php @@ -19,8 +19,7 @@ final class CurrencyStorage implements CurrencyStorageInterface { - /** @var StorageInterface */ - private $storage; + private StorageInterface $storage; public function __construct(StorageInterface $storage) { diff --git a/src/Sylius/Component/Core/Customer/CustomerOrderAddressesSaver.php b/src/Sylius/Component/Core/Customer/CustomerOrderAddressesSaver.php index e00d5f7c46a..707dbbd58df 100644 --- a/src/Sylius/Component/Core/Customer/CustomerOrderAddressesSaver.php +++ b/src/Sylius/Component/Core/Customer/CustomerOrderAddressesSaver.php @@ -19,8 +19,7 @@ final class CustomerOrderAddressesSaver implements OrderAddressesSaverInterface { - /** @var CustomerAddressAdderInterface */ - private $addressAdder; + private CustomerAddressAdderInterface $addressAdder; public function __construct(CustomerAddressAdderInterface $addressAdder) { diff --git a/src/Sylius/Component/Core/Customer/CustomerUniqueAddressAdder.php b/src/Sylius/Component/Core/Customer/CustomerUniqueAddressAdder.php index 118f337f29c..3fd9ecd3453 100644 --- a/src/Sylius/Component/Core/Customer/CustomerUniqueAddressAdder.php +++ b/src/Sylius/Component/Core/Customer/CustomerUniqueAddressAdder.php @@ -19,8 +19,7 @@ final class CustomerUniqueAddressAdder implements CustomerAddressAdderInterface { - /** @var AddressComparatorInterface */ - private $addressComparator; + private AddressComparatorInterface $addressComparator; public function __construct(AddressComparatorInterface $addressComparator) { diff --git a/src/Sylius/Component/Core/Customer/Statistics/CustomerStatisticsProvider.php b/src/Sylius/Component/Core/Customer/Statistics/CustomerStatisticsProvider.php index 772844b8477..36db05b89fe 100644 --- a/src/Sylius/Component/Core/Customer/Statistics/CustomerStatisticsProvider.php +++ b/src/Sylius/Component/Core/Customer/Statistics/CustomerStatisticsProvider.php @@ -21,11 +21,9 @@ final class CustomerStatisticsProvider implements CustomerStatisticsProviderInterface { - /** @var OrderRepositoryInterface */ - private $orderRepository; + private OrderRepositoryInterface $orderRepository; - /** @var RepositoryInterface */ - private $channelRepository; + private RepositoryInterface $channelRepository; public function __construct(OrderRepositoryInterface $orderRepository, RepositoryInterface $channelRepository) { diff --git a/src/Sylius/Component/Core/Customer/Statistics/PerChannelCustomerStatistics.php b/src/Sylius/Component/Core/Customer/Statistics/PerChannelCustomerStatistics.php index 5e89cf8c566..7d21c9f9d57 100644 --- a/src/Sylius/Component/Core/Customer/Statistics/PerChannelCustomerStatistics.php +++ b/src/Sylius/Component/Core/Customer/Statistics/PerChannelCustomerStatistics.php @@ -17,14 +17,11 @@ final class PerChannelCustomerStatistics { - /** @var int */ - private $ordersCount; + private int $ordersCount; - /** @var int */ - private $ordersValue; + private int $ordersValue; - /** @var ChannelInterface */ - private $channel; + private ChannelInterface $channel; /** * @throws \InvalidArgumentException diff --git a/src/Sylius/Component/Core/Dashboard/DashboardStatistics.php b/src/Sylius/Component/Core/Dashboard/DashboardStatistics.php index 9ea308be65e..4dd60296a74 100644 --- a/src/Sylius/Component/Core/Dashboard/DashboardStatistics.php +++ b/src/Sylius/Component/Core/Dashboard/DashboardStatistics.php @@ -17,17 +17,13 @@ class DashboardStatistics { - /** @var int */ - private $totalSales; + private int $totalSales; - /** @var int */ - private $numberOfNewOrders; + private int $numberOfNewOrders; - /** @var int */ - private $numberOfNewCustomers; + private int $numberOfNewCustomers; - /** @var ChannelInterface */ - private $channel; + private ?ChannelInterface $channel; /** * @throws \InvalidArgumentException diff --git a/src/Sylius/Component/Core/Dashboard/DashboardStatisticsProvider.php b/src/Sylius/Component/Core/Dashboard/DashboardStatisticsProvider.php index eb5ef4a5682..e10e0e13d9f 100644 --- a/src/Sylius/Component/Core/Dashboard/DashboardStatisticsProvider.php +++ b/src/Sylius/Component/Core/Dashboard/DashboardStatisticsProvider.php @@ -19,11 +19,9 @@ class DashboardStatisticsProvider implements DashboardStatisticsProviderInterface { - /** @var OrderRepositoryInterface */ - private $orderRepository; + private OrderRepositoryInterface $orderRepository; - /** @var CustomerRepositoryInterface */ - private $customerRepository; + private CustomerRepositoryInterface $customerRepository; public function __construct( OrderRepositoryInterface $orderRepository, diff --git a/src/Sylius/Component/Core/Dashboard/Interval.php b/src/Sylius/Component/Core/Dashboard/Interval.php index 2b8cef655c4..9ee50b93391 100644 --- a/src/Sylius/Component/Core/Dashboard/Interval.php +++ b/src/Sylius/Component/Core/Dashboard/Interval.php @@ -15,8 +15,7 @@ final class Interval { - /** @var string */ - private $interval; + private string $interval; private function __construct(string $interval) { diff --git a/src/Sylius/Component/Core/Dashboard/SalesDataProvider.php b/src/Sylius/Component/Core/Dashboard/SalesDataProvider.php index 86c96d1dc1e..a27dc565055 100644 --- a/src/Sylius/Component/Core/Dashboard/SalesDataProvider.php +++ b/src/Sylius/Component/Core/Dashboard/SalesDataProvider.php @@ -22,8 +22,7 @@ */ final class SalesDataProvider implements SalesDataProviderInterface { - /** @var EntityRepository */ - private $orderRepository; + private EntityRepository $orderRepository; public function __construct(EntityRepository $orderRepository) { diff --git a/src/Sylius/Component/Core/Dashboard/SalesSummary.php b/src/Sylius/Component/Core/Dashboard/SalesSummary.php index 3453c035cd7..18d22dc72e8 100644 --- a/src/Sylius/Component/Core/Dashboard/SalesSummary.php +++ b/src/Sylius/Component/Core/Dashboard/SalesSummary.php @@ -19,7 +19,7 @@ final class SalesSummary implements SalesSummaryInterface { /** @psalm-var array */ - private $intervalsSalesMap = []; + private array $intervalsSalesMap = []; public function __construct( array $salesData diff --git a/src/Sylius/Component/Core/Factory/AddressFactory.php b/src/Sylius/Component/Core/Factory/AddressFactory.php index cd02e574abc..5a299c9a4c7 100644 --- a/src/Sylius/Component/Core/Factory/AddressFactory.php +++ b/src/Sylius/Component/Core/Factory/AddressFactory.php @@ -19,8 +19,7 @@ class AddressFactory implements AddressFactoryInterface { - /** @var FactoryInterface */ - private $decoratedFactory; + private FactoryInterface $decoratedFactory; public function __construct(FactoryInterface $decoratedFactory) { diff --git a/src/Sylius/Component/Core/Factory/CartItemFactory.php b/src/Sylius/Component/Core/Factory/CartItemFactory.php index 1bbe20dde33..60d4bec9e64 100644 --- a/src/Sylius/Component/Core/Factory/CartItemFactory.php +++ b/src/Sylius/Component/Core/Factory/CartItemFactory.php @@ -21,11 +21,9 @@ final class CartItemFactory implements CartItemFactoryInterface { - /** @var FactoryInterface */ - private $decoratedFactory; + private FactoryInterface $decoratedFactory; - /** @var ProductVariantResolverInterface */ - private $variantResolver; + private ProductVariantResolverInterface $variantResolver; public function __construct(FactoryInterface $decoratedFactory, ProductVariantResolverInterface $variantResolver) { diff --git a/src/Sylius/Component/Core/Factory/ChannelFactory.php b/src/Sylius/Component/Core/Factory/ChannelFactory.php index facbd3c5c7d..ba5e5fd3158 100644 --- a/src/Sylius/Component/Core/Factory/ChannelFactory.php +++ b/src/Sylius/Component/Core/Factory/ChannelFactory.php @@ -20,11 +20,9 @@ final class ChannelFactory implements ChannelFactoryInterface { - /** @var FactoryInterface */ - private $decoratedFactory; + private FactoryInterface $decoratedFactory; - /** @var string */ - private $defaultCalculationStrategy; + private string $defaultCalculationStrategy; public function __construct(FactoryInterface $decoratedFactory, string $defaultCalculationStrategy) { diff --git a/src/Sylius/Component/Core/Factory/CustomerAfterCheckoutFactory.php b/src/Sylius/Component/Core/Factory/CustomerAfterCheckoutFactory.php index 7cb0b769b4f..e01020f1849 100644 --- a/src/Sylius/Component/Core/Factory/CustomerAfterCheckoutFactory.php +++ b/src/Sylius/Component/Core/Factory/CustomerAfterCheckoutFactory.php @@ -19,8 +19,7 @@ final class CustomerAfterCheckoutFactory implements CustomerAfterCheckoutFactoryInterface { - /** @var FactoryInterface */ - private $baseCustomerFactory; + private FactoryInterface $baseCustomerFactory; public function __construct(FactoryInterface $baseCustomerFactory) { diff --git a/src/Sylius/Component/Core/Factory/PaymentMethodFactory.php b/src/Sylius/Component/Core/Factory/PaymentMethodFactory.php index 5656c681423..79602b28f5c 100644 --- a/src/Sylius/Component/Core/Factory/PaymentMethodFactory.php +++ b/src/Sylius/Component/Core/Factory/PaymentMethodFactory.php @@ -19,11 +19,9 @@ final class PaymentMethodFactory implements PaymentMethodFactoryInterface { - /** @var FactoryInterface */ - private $decoratedFactory; + private FactoryInterface $decoratedFactory; - /** @var FactoryInterface */ - private $gatewayConfigFactory; + private FactoryInterface $gatewayConfigFactory; public function __construct(FactoryInterface $decoratedFactory, FactoryInterface $gatewayConfigFactory) { diff --git a/src/Sylius/Component/Core/Factory/PromotionActionFactory.php b/src/Sylius/Component/Core/Factory/PromotionActionFactory.php index 4870d740f1a..4fbfd31c0a0 100644 --- a/src/Sylius/Component/Core/Factory/PromotionActionFactory.php +++ b/src/Sylius/Component/Core/Factory/PromotionActionFactory.php @@ -23,8 +23,7 @@ final class PromotionActionFactory implements PromotionActionFactoryInterface { - /** @var FactoryInterface */ - private $decoratedFactory; + private FactoryInterface $decoratedFactory; public function __construct(FactoryInterface $decoratedFactory) { diff --git a/src/Sylius/Component/Core/Factory/PromotionRuleFactory.php b/src/Sylius/Component/Core/Factory/PromotionRuleFactory.php index 3bf7a450896..f06f3fe94db 100644 --- a/src/Sylius/Component/Core/Factory/PromotionRuleFactory.php +++ b/src/Sylius/Component/Core/Factory/PromotionRuleFactory.php @@ -24,8 +24,7 @@ final class PromotionRuleFactory implements PromotionRuleFactoryInterface { - /** @var FactoryInterface */ - private $decoratedFactory; + private FactoryInterface $decoratedFactory; public function __construct(FactoryInterface $decoratedFactory) { diff --git a/src/Sylius/Component/Core/Locale/Context/StorageBasedLocaleContext.php b/src/Sylius/Component/Core/Locale/Context/StorageBasedLocaleContext.php index 934f3a3381a..c030e44509b 100644 --- a/src/Sylius/Component/Core/Locale/Context/StorageBasedLocaleContext.php +++ b/src/Sylius/Component/Core/Locale/Context/StorageBasedLocaleContext.php @@ -22,14 +22,11 @@ final class StorageBasedLocaleContext implements LocaleContextInterface { - /** @var ChannelContextInterface */ - private $channelContext; + private ChannelContextInterface $channelContext; - /** @var LocaleStorageInterface */ - private $localeStorage; + private LocaleStorageInterface $localeStorage; - /** @var LocaleProviderInterface */ - private $localeProvider; + private LocaleProviderInterface $localeProvider; public function __construct( ChannelContextInterface $channelContext, diff --git a/src/Sylius/Component/Core/Locale/LocaleStorage.php b/src/Sylius/Component/Core/Locale/LocaleStorage.php index 57e934262aa..0496259ba20 100644 --- a/src/Sylius/Component/Core/Locale/LocaleStorage.php +++ b/src/Sylius/Component/Core/Locale/LocaleStorage.php @@ -19,8 +19,7 @@ final class LocaleStorage implements LocaleStorageInterface { - /** @var StorageInterface */ - private $storage; + private StorageInterface $storage; public function __construct(StorageInterface $storage) { diff --git a/src/Sylius/Component/Core/Model/Adjustment.php b/src/Sylius/Component/Core/Model/Adjustment.php index 7ce5a03df18..732f5c1de0f 100644 --- a/src/Sylius/Component/Core/Model/Adjustment.php +++ b/src/Sylius/Component/Core/Model/Adjustment.php @@ -17,8 +17,7 @@ class Adjustment extends BaseAdjustment implements AdjustmentInterface { - /** @var ShipmentInterface|null */ - protected $shipment; + protected ?ShipmentInterface $shipment = null; public function getShipment(): ?ShipmentInterface { diff --git a/src/Sylius/Component/Core/Model/AdminUser.php b/src/Sylius/Component/Core/Model/AdminUser.php index 6e5a0dce6a8..548663bb34b 100644 --- a/src/Sylius/Component/Core/Model/AdminUser.php +++ b/src/Sylius/Component/Core/Model/AdminUser.php @@ -17,17 +17,13 @@ class AdminUser extends User implements AdminUserInterface { - /** @var string */ - protected $firstName; + protected ?string $firstName = null; - /** @var string */ - protected $lastName; + protected ?string $lastName = null; - /** @var string */ - protected $localeCode; + protected ?string $localeCode = null; - /** @var ImageInterface */ - protected $avatar; + protected ?ImageInterface $avatar = null; public function __construct() { diff --git a/src/Sylius/Component/Core/Model/Channel.php b/src/Sylius/Component/Core/Model/Channel.php index c98eb2ecfcc..3476746cf5c 100644 --- a/src/Sylius/Component/Core/Model/Channel.php +++ b/src/Sylius/Component/Core/Model/Channel.php @@ -23,62 +23,50 @@ class Channel extends BaseChannel implements ChannelInterface { - /** @var CurrencyInterface */ - protected $baseCurrency; + protected ?CurrencyInterface $baseCurrency = null; - /** @var LocaleInterface */ - protected $defaultLocale; + protected ?LocaleInterface $defaultLocale = null; - /** @var ZoneInterface */ - protected $defaultTaxZone; + protected ?ZoneInterface $defaultTaxZone = null; - /** @var string */ - protected $taxCalculationStrategy; + protected ?string $taxCalculationStrategy = null; /** * @var Collection|CurrencyInterface[] * * @psalm-var Collection */ - protected $currencies; + protected Collection $currencies; /** * @var Collection|LocaleInterface[] * * @psalm-var Collection */ - protected $locales; + protected Collection $locales; /** * @var Collection|CountryInterface[] * * @psalm-var Collection */ - protected $countries; + protected Collection $countries; - /** @var string */ - protected $themeName; + protected ?string $themeName = null; - /** @var string */ - protected $contactEmail; + protected ?string $contactEmail = null; - /** @var string|null */ - protected $contactPhoneNumber; + protected ?string $contactPhoneNumber = null; - /** @var bool */ - protected $skippingShippingStepAllowed = false; + protected bool $skippingShippingStepAllowed = false; - /** @var bool */ - protected $skippingPaymentStepAllowed = false; + protected bool $skippingPaymentStepAllowed = false; - /** @var bool */ - protected $accountVerificationRequired = true; + protected bool $accountVerificationRequired = true; - /** @var ShopBillingDataInterface|null */ - protected $shopBillingData; + protected ?ShopBillingDataInterface $shopBillingData = null; - /** @var TaxonInterface|null */ - protected $menuTaxon; + protected ?TaxonInterface $menuTaxon = null; public function __construct() { diff --git a/src/Sylius/Component/Core/Model/ChannelPricing.php b/src/Sylius/Component/Core/Model/ChannelPricing.php index e5981cab565..677209df552 100644 --- a/src/Sylius/Component/Core/Model/ChannelPricing.php +++ b/src/Sylius/Component/Core/Model/ChannelPricing.php @@ -15,20 +15,16 @@ class ChannelPricing implements ChannelPricingInterface { - /** @var int|null */ - protected $id; + /** @var mixed */ + protected $id = null; - /** @var string|null */ - protected $channelCode; + protected ?string $channelCode = null; - /** @var ProductVariantInterface|null */ - protected $productVariant; + protected ?ProductVariantInterface $productVariant = null; - /** @var int|null */ - protected $price; + protected ?int $price = null; - /** @var int|null */ - protected $originalPrice; + protected ?int $originalPrice = null; public function __toString(): string { diff --git a/src/Sylius/Component/Core/Model/Customer.php b/src/Sylius/Component/Core/Model/Customer.php index cd510475e73..57b1bcd262a 100644 --- a/src/Sylius/Component/Core/Model/Customer.php +++ b/src/Sylius/Component/Core/Model/Customer.php @@ -26,20 +26,18 @@ class Customer extends BaseCustomer implements CustomerInterface * * @psalm-var Collection */ - protected $orders; + protected Collection $orders; - /** @var AddressInterface|null */ - protected $defaultAddress; + protected ?AddressInterface $defaultAddress = null; /** * @var Collection|AddressInterface[] * * @psalm-var Collection */ - protected $addresses; + protected Collection $addresses; - /** @var ShopUserInterface|null */ - protected $user; + protected ?ShopUserInterface $user = null; public function __construct() { diff --git a/src/Sylius/Component/Core/Model/Image.php b/src/Sylius/Component/Core/Model/Image.php index 4ac31d1d1cc..187e5bbbb02 100644 --- a/src/Sylius/Component/Core/Model/Image.php +++ b/src/Sylius/Component/Core/Model/Image.php @@ -16,23 +16,16 @@ abstract class Image implements ImageInterface { /** @var mixed */ - protected $id; + protected $id = null; - /** @var string|null */ - protected $type; + protected ?string $type = null; - /** @var \SplFileInfo|null */ - protected $file; + protected ?\SplFileInfo $file = null; - /** @var string|null */ - protected $path; + protected ?string $path = null; - /** @var object|null */ - protected $owner; + protected ?object $owner = null; - /** - * @return int - */ public function getId() { return $this->id; diff --git a/src/Sylius/Component/Core/Model/Order.php b/src/Sylius/Component/Core/Model/Order.php index e807b9964b3..f39d8c56760 100644 --- a/src/Sylius/Component/Core/Model/Order.php +++ b/src/Sylius/Component/Core/Model/Order.php @@ -29,62 +29,50 @@ class Order extends BaseOrder implements OrderInterface { - /** @var CustomerInterface|null */ - protected $customer; + protected ?CustomerInterface $customer = null; - /** @var ChannelInterface|null */ - protected $channel; + protected ?ChannelInterface $channel = null; - /** @var AddressInterface|null */ - protected $shippingAddress; + protected ?AddressInterface $shippingAddress = null; - /** @var AddressInterface|null */ - protected $billingAddress; + protected ?AddressInterface $billingAddress = null; /** * @var Collection|PaymentInterface[] * * @psalm-var Collection */ - protected $payments; + protected Collection $payments; /** * @var Collection|ShipmentInterface[] * * @psalm-var Collection */ - protected $shipments; + protected Collection $shipments; - /** @var string|null */ - protected $currencyCode; + protected ?string $currencyCode = null; - /** @var string|null */ - protected $localeCode; + protected ?string $localeCode = null; - /** @var BaseCouponInterface|null */ - protected $promotionCoupon; + protected ?BaseCouponInterface $promotionCoupon = null; - /** @var string */ - protected $checkoutState = OrderCheckoutStates::STATE_CART; + protected ?string $checkoutState = OrderCheckoutStates::STATE_CART; - /** @var string */ - protected $paymentState = OrderPaymentStates::STATE_CART; + protected ?string $paymentState = OrderPaymentStates::STATE_CART; - /** @var string */ - protected $shippingState = OrderShippingStates::STATE_CART; + protected ?string $shippingState = OrderShippingStates::STATE_CART; /** * @var Collection|BasePromotionInterface[] * * @psalm-var Collection */ - protected $promotions; + protected Collection $promotions; - /** @var string|null */ - protected $tokenValue; + protected ?string $tokenValue = null; - /** @var string|null */ - protected $customerIp; + protected ?string $customerIp = null; public function __construct() { diff --git a/src/Sylius/Component/Core/Model/OrderItem.php b/src/Sylius/Component/Core/Model/OrderItem.php index 4bff10314cb..9fff4394054 100644 --- a/src/Sylius/Component/Core/Model/OrderItem.php +++ b/src/Sylius/Component/Core/Model/OrderItem.php @@ -19,17 +19,13 @@ class OrderItem extends BaseOrderItem implements OrderItemInterface { - /** @var int */ - protected $version = 1; + protected ?int $version = 1; - /** @var ProductVariantInterface */ - protected $variant; + protected ?ProductVariantInterface $variant = null; - /** @var string */ - protected $productName; + protected ?string $productName = null; - /** @var string */ - protected $variantName; + protected ?string $variantName = null; public function getVersion(): ?int { diff --git a/src/Sylius/Component/Core/Model/OrderSequence.php b/src/Sylius/Component/Core/Model/OrderSequence.php index 6b648e03804..1fea8b70566 100644 --- a/src/Sylius/Component/Core/Model/OrderSequence.php +++ b/src/Sylius/Component/Core/Model/OrderSequence.php @@ -17,8 +17,7 @@ class OrderSequence extends BaseOrderSequence implements OrderSequenceInterface { - /** @var int */ - protected $version = 1; + protected ?int $version = 1; public function getVersion(): ?int { diff --git a/src/Sylius/Component/Core/Model/PaymentMethod.php b/src/Sylius/Component/Core/Model/PaymentMethod.php index 931dac70890..78f1b630ad1 100644 --- a/src/Sylius/Component/Core/Model/PaymentMethod.php +++ b/src/Sylius/Component/Core/Model/PaymentMethod.php @@ -27,10 +27,9 @@ class PaymentMethod extends BasePaymentMethod implements PaymentMethodInterface * * @psalm-var Collection */ - protected $channels; + protected Collection $channels; - /** @var GatewayConfigInterface */ - protected $gatewayConfig; + protected ?GatewayConfigInterface $gatewayConfig = null; public function __construct() { diff --git a/src/Sylius/Component/Core/Model/Product.php b/src/Sylius/Component/Core/Model/Product.php index 37af006310f..b79c512782f 100644 --- a/src/Sylius/Component/Core/Model/Product.php +++ b/src/Sylius/Component/Core/Model/Product.php @@ -25,42 +25,39 @@ class Product extends BaseProduct implements ProductInterface, ReviewableProductInterface { - /** @var string */ - protected $variantSelectionMethod = self::VARIANT_SELECTION_CHOICE; + protected ?string $variantSelectionMethod = self::VARIANT_SELECTION_CHOICE; /** * @var Collection|ProductTaxonInterface[] * * @psalm-var Collection */ - protected $productTaxons; + protected Collection $productTaxons; /** * @var Collection|ChannelInterface[] * * @psalm-var Collection */ - protected $channels; + protected Collection $channels; - /** @var BaseTaxonInterface */ - protected $mainTaxon; + protected ?TaxonInterface $mainTaxon = null; /** * @var Collection|ReviewInterface[] * * @psalm-var Collection */ - protected $reviews; + protected Collection $reviews; - /** @var float */ - protected $averageRating = 0; + protected float $averageRating = 0.0; /** * @var Collection|ImageInterface[] * * @psalm-var Collection */ - protected $images; + protected Collection $images; public function __construct() { diff --git a/src/Sylius/Component/Core/Model/ProductImage.php b/src/Sylius/Component/Core/Model/ProductImage.php index 58928f6c3f7..73b5008ddcc 100644 --- a/src/Sylius/Component/Core/Model/ProductImage.php +++ b/src/Sylius/Component/Core/Model/ProductImage.php @@ -23,7 +23,7 @@ class ProductImage extends Image implements ProductImageInterface * * @psalm-var Collection */ - protected $productVariants; + protected Collection $productVariants; public function __construct() { diff --git a/src/Sylius/Component/Core/Model/ProductTaxon.php b/src/Sylius/Component/Core/Model/ProductTaxon.php index 3def5036ce7..eabe1f94012 100644 --- a/src/Sylius/Component/Core/Model/ProductTaxon.php +++ b/src/Sylius/Component/Core/Model/ProductTaxon.php @@ -18,14 +18,11 @@ class ProductTaxon implements ProductTaxonInterface /** @var mixed */ protected $id; - /** @var ProductInterface|null */ - protected $product; + protected ?ProductInterface $product = null; - /** @var TaxonInterface|null */ - protected $taxon; + protected ?TaxonInterface $taxon = null; - /** @var int|null */ - protected $position; + protected ?int $position = null; public function getId() { diff --git a/src/Sylius/Component/Core/Model/ProductTranslation.php b/src/Sylius/Component/Core/Model/ProductTranslation.php index 1d2a95f91af..adb64fd3cc2 100644 --- a/src/Sylius/Component/Core/Model/ProductTranslation.php +++ b/src/Sylius/Component/Core/Model/ProductTranslation.php @@ -17,8 +17,7 @@ class ProductTranslation extends BaseProductTranslation implements ProductTranslationInterface { - /** @var string|null */ - protected $shortDescription; + protected ?string $shortDescription = null; public function getShortDescription(): ?string { diff --git a/src/Sylius/Component/Core/Model/ProductVariant.php b/src/Sylius/Component/Core/Model/ProductVariant.php index e0e8ac9563e..b30875a13fb 100644 --- a/src/Sylius/Component/Core/Model/ProductVariant.php +++ b/src/Sylius/Component/Core/Model/ProductVariant.php @@ -22,48 +22,36 @@ class ProductVariant extends BaseVariant implements ProductVariantInterface, Comparable { - /** @var int */ - protected $version = 1; + protected ?int $version = 1; - /** @var int */ - protected $onHold = 0; + protected ?int $onHold = 0; - /** @var int */ - protected $onHand = 0; + protected ?int $onHand = 0; - /** @var bool */ - protected $tracked = false; + protected bool $tracked = false; - /** @var float */ - protected $weight; + protected ?float $weight = null; - /** @var float */ - protected $width; + protected ?float $width = null; - /** @var float */ - protected $height; + protected ?float $height = null; - /** @var float */ - protected $depth; + protected ?float $depth = null; - /** @var TaxCategoryInterface */ - protected $taxCategory; + protected ?TaxCategoryInterface $taxCategory = null; - /** @var ShippingCategoryInterface */ - protected $shippingCategory; + protected ?ShippingCategoryInterface $shippingCategory = null; - /** @var Collection */ - protected $channelPricings; + protected Collection $channelPricings; - /** @var bool */ - protected $shippingRequired = true; + protected bool $shippingRequired = true; /** * @var Collection|ProductImageInterface[] * * @psalm-var Collection */ - protected $images; + protected Collection $images; public function __construct() { diff --git a/src/Sylius/Component/Core/Model/Promotion.php b/src/Sylius/Component/Core/Model/Promotion.php index 689a3c9cf89..a32471df51e 100644 --- a/src/Sylius/Component/Core/Model/Promotion.php +++ b/src/Sylius/Component/Core/Model/Promotion.php @@ -25,7 +25,7 @@ class Promotion extends BasePromotion implements PromotionInterface * * @psalm-var Collection */ - protected $channels; + protected Collection $channels; public function __construct() { diff --git a/src/Sylius/Component/Core/Model/PromotionCoupon.php b/src/Sylius/Component/Core/Model/PromotionCoupon.php index 06298985cb8..8cbef871c58 100644 --- a/src/Sylius/Component/Core/Model/PromotionCoupon.php +++ b/src/Sylius/Component/Core/Model/PromotionCoupon.php @@ -17,11 +17,9 @@ class PromotionCoupon extends BasePromotionCoupon implements PromotionCouponInterface { - /** @var int|null */ - protected $perCustomerUsageLimit; + protected ?int $perCustomerUsageLimit = null; - /** @var bool */ - protected $reusableFromCancelledOrders = true; + protected bool $reusableFromCancelledOrders = true; public function getPerCustomerUsageLimit(): ?int { diff --git a/src/Sylius/Component/Core/Model/Shipment.php b/src/Sylius/Component/Core/Model/Shipment.php index 7d9af9acc65..815eb17e9ee 100644 --- a/src/Sylius/Component/Core/Model/Shipment.php +++ b/src/Sylius/Component/Core/Model/Shipment.php @@ -29,10 +29,9 @@ class Shipment extends BaseShipment implements ShipmentInterface * * @psalm-var Collection */ - protected $adjustments; + protected Collection $adjustments; - /** @var int */ - protected $adjustmentsTotal = 0; + protected int $adjustmentsTotal = 0; public function __construct() { diff --git a/src/Sylius/Component/Core/Model/ShippingMethod.php b/src/Sylius/Component/Core/Model/ShippingMethod.php index 8b79a76d9fc..c2c875520de 100644 --- a/src/Sylius/Component/Core/Model/ShippingMethod.php +++ b/src/Sylius/Component/Core/Model/ShippingMethod.php @@ -23,18 +23,16 @@ class ShippingMethod extends BaseShippingMethod implements ShippingMethodInterface { - /** @var ZoneInterface */ - protected $zone; + protected ?ZoneInterface $zone = null; - /** @var TaxCategoryInterface */ - protected $taxCategory; + protected ?TaxCategoryInterface $taxCategory = null; /** * @var Collection|ChannelInterface[] * * @psalm-var Collection */ - protected $channels; + protected Collection $channels; public function __construct() { diff --git a/src/Sylius/Component/Core/Model/ShopBillingData.php b/src/Sylius/Component/Core/Model/ShopBillingData.php index ac2228a696e..f722e76996f 100644 --- a/src/Sylius/Component/Core/Model/ShopBillingData.php +++ b/src/Sylius/Component/Core/Model/ShopBillingData.php @@ -15,26 +15,20 @@ class ShopBillingData implements ShopBillingDataInterface { - /** @var int|null */ - protected $id; + /** @var mixed */ + protected $id = null; - /** @var string|null */ - protected $company; + protected ?string $company = null; - /** @var string|null */ - protected $taxId; + protected ?string $taxId = null; - /** @var string|null */ - protected $countryCode; + protected ?string $countryCode = null; - /** @var string|null */ - protected $street; + protected ?string $street = null; - /** @var string|null */ - protected $city; + protected ?string $city = null; - /** @var string|null */ - protected $postcode; + protected ?string $postcode = null; public function getId() { diff --git a/src/Sylius/Component/Core/Model/TaxRate.php b/src/Sylius/Component/Core/Model/TaxRate.php index 70650567835..3efb8735a79 100644 --- a/src/Sylius/Component/Core/Model/TaxRate.php +++ b/src/Sylius/Component/Core/Model/TaxRate.php @@ -18,8 +18,7 @@ class TaxRate extends BaseTaxRate implements TaxRateInterface { - /** @var ZoneInterface */ - protected $zone; + protected ?ZoneInterface $zone = null; public function getZone(): ?ZoneInterface { diff --git a/src/Sylius/Component/Core/Model/Taxon.php b/src/Sylius/Component/Core/Model/Taxon.php index 40d1edbb6bc..428624b9846 100644 --- a/src/Sylius/Component/Core/Model/Taxon.php +++ b/src/Sylius/Component/Core/Model/Taxon.php @@ -29,7 +29,7 @@ class Taxon extends BaseTaxon implements TaxonInterface, Comparable * * @psalm-var Collection */ - protected $images; + protected Collection $images; public function __construct() { diff --git a/src/Sylius/Component/Core/OrderProcessing/OrderAdjustmentsClearer.php b/src/Sylius/Component/Core/OrderProcessing/OrderAdjustmentsClearer.php index 222b73a3430..081cf873292 100644 --- a/src/Sylius/Component/Core/OrderProcessing/OrderAdjustmentsClearer.php +++ b/src/Sylius/Component/Core/OrderProcessing/OrderAdjustmentsClearer.php @@ -19,8 +19,7 @@ final class OrderAdjustmentsClearer implements OrderProcessorInterface { - /** @var array */ - private $adjustmentsToRemove; + private array $adjustmentsToRemove; public function __construct(array $adjustmentsToRemove = []) { diff --git a/src/Sylius/Component/Core/OrderProcessing/OrderPaymentProcessor.php b/src/Sylius/Component/Core/OrderProcessing/OrderPaymentProcessor.php index 1ca822419de..71980b62abb 100644 --- a/src/Sylius/Component/Core/OrderProcessing/OrderPaymentProcessor.php +++ b/src/Sylius/Component/Core/OrderProcessing/OrderPaymentProcessor.php @@ -24,11 +24,9 @@ final class OrderPaymentProcessor implements OrderProcessorInterface { - /** @var OrderPaymentProviderInterface */ - private $orderPaymentProvider; + private OrderPaymentProviderInterface $orderPaymentProvider; - /** @var string */ - private $targetState; + private string $targetState; public function __construct( OrderPaymentProviderInterface $orderPaymentProvider, diff --git a/src/Sylius/Component/Core/OrderProcessing/OrderPricesRecalculator.php b/src/Sylius/Component/Core/OrderProcessing/OrderPricesRecalculator.php index b56931d1e38..6ee1df5e2c3 100644 --- a/src/Sylius/Component/Core/OrderProcessing/OrderPricesRecalculator.php +++ b/src/Sylius/Component/Core/OrderProcessing/OrderPricesRecalculator.php @@ -21,8 +21,7 @@ final class OrderPricesRecalculator implements OrderProcessorInterface { - /** @var ProductVariantPriceCalculatorInterface */ - private $productVariantPriceCalculator; + private ProductVariantPriceCalculatorInterface $productVariantPriceCalculator; public function __construct(ProductVariantPriceCalculatorInterface $productVariantPriceCalculator) { diff --git a/src/Sylius/Component/Core/OrderProcessing/OrderPromotionProcessor.php b/src/Sylius/Component/Core/OrderProcessing/OrderPromotionProcessor.php index 9d8d9499668..45ccdf17cab 100644 --- a/src/Sylius/Component/Core/OrderProcessing/OrderPromotionProcessor.php +++ b/src/Sylius/Component/Core/OrderProcessing/OrderPromotionProcessor.php @@ -21,8 +21,7 @@ final class OrderPromotionProcessor implements OrderProcessorInterface { - /** @var PromotionProcessorInterface */ - private $promotionProcessor; + private PromotionProcessorInterface $promotionProcessor; public function __construct(PromotionProcessorInterface $promotionProcessor) { diff --git a/src/Sylius/Component/Core/OrderProcessing/OrderShipmentProcessor.php b/src/Sylius/Component/Core/OrderProcessing/OrderShipmentProcessor.php index 38c6b988640..e4aad2b6676 100644 --- a/src/Sylius/Component/Core/OrderProcessing/OrderShipmentProcessor.php +++ b/src/Sylius/Component/Core/OrderProcessing/OrderShipmentProcessor.php @@ -25,14 +25,11 @@ final class OrderShipmentProcessor implements OrderProcessorInterface { - /** @var DefaultShippingMethodResolverInterface */ - private $defaultShippingMethodResolver; + private DefaultShippingMethodResolverInterface $defaultShippingMethodResolver; - /** @var FactoryInterface */ - private $shipmentFactory; + private FactoryInterface $shipmentFactory; - /** @var ShippingMethodsResolverInterface|null */ - private $shippingMethodsResolver; + private ?ShippingMethodsResolverInterface $shippingMethodsResolver; public function __construct( DefaultShippingMethodResolverInterface $defaultShippingMethodResolver, diff --git a/src/Sylius/Component/Core/OrderProcessing/OrderTaxesProcessor.php b/src/Sylius/Component/Core/OrderProcessing/OrderTaxesProcessor.php index a39978abb46..facf9397acb 100644 --- a/src/Sylius/Component/Core/OrderProcessing/OrderTaxesProcessor.php +++ b/src/Sylius/Component/Core/OrderProcessing/OrderTaxesProcessor.php @@ -29,14 +29,11 @@ final class OrderTaxesProcessor implements OrderProcessorInterface { - /** @var ZoneProviderInterface */ - private $defaultTaxZoneProvider; + private ZoneProviderInterface $defaultTaxZoneProvider; - /** @var ZoneMatcherInterface */ - private $zoneMatcher; + private ZoneMatcherInterface $zoneMatcher; - /** @var PrioritizedServiceRegistryInterface */ - private $strategyRegistry; + private PrioritizedServiceRegistryInterface $strategyRegistry; public function __construct( ZoneProviderInterface $defaultTaxZoneProvider, diff --git a/src/Sylius/Component/Core/OrderProcessing/ShippingChargesProcessor.php b/src/Sylius/Component/Core/OrderProcessing/ShippingChargesProcessor.php index 58f8dc62f4e..557e58dbb56 100644 --- a/src/Sylius/Component/Core/OrderProcessing/ShippingChargesProcessor.php +++ b/src/Sylius/Component/Core/OrderProcessing/ShippingChargesProcessor.php @@ -24,11 +24,9 @@ final class ShippingChargesProcessor implements OrderProcessorInterface { - /** @var FactoryInterface */ - private $adjustmentFactory; + private FactoryInterface $adjustmentFactory; - /** @var DelegatingCalculatorInterface */ - private $shippingChargesCalculator; + private DelegatingCalculatorInterface $shippingChargesCalculator; public function __construct( FactoryInterface $adjustmentFactory, diff --git a/src/Sylius/Component/Core/Payment/Provider/OrderPaymentProvider.php b/src/Sylius/Component/Core/Payment/Provider/OrderPaymentProvider.php index 933a11b7445..0a0802f9294 100644 --- a/src/Sylius/Component/Core/Payment/Provider/OrderPaymentProvider.php +++ b/src/Sylius/Component/Core/Payment/Provider/OrderPaymentProvider.php @@ -26,14 +26,11 @@ final class OrderPaymentProvider implements OrderPaymentProviderInterface { - /** @var DefaultPaymentMethodResolverInterface */ - private $defaultPaymentMethodResolver; + private DefaultPaymentMethodResolverInterface $defaultPaymentMethodResolver; - /** @var PaymentFactoryInterface */ - private $paymentFactory; + private PaymentFactoryInterface $paymentFactory; - /** @var StateMachineFactoryInterface */ - private $stateMachineFactory; + private StateMachineFactoryInterface $stateMachineFactory; public function __construct( DefaultPaymentMethodResolverInterface $defaultPaymentMethodResolver, diff --git a/src/Sylius/Component/Core/Promotion/Action/FixedDiscountPromotionActionCommand.php b/src/Sylius/Component/Core/Promotion/Action/FixedDiscountPromotionActionCommand.php index 3562ea3fcc4..5d2a60c0114 100644 --- a/src/Sylius/Component/Core/Promotion/Action/FixedDiscountPromotionActionCommand.php +++ b/src/Sylius/Component/Core/Promotion/Action/FixedDiscountPromotionActionCommand.php @@ -24,11 +24,9 @@ final class FixedDiscountPromotionActionCommand extends DiscountPromotionActionC { public const TYPE = 'order_fixed_discount'; - /** @var ProportionalIntegerDistributorInterface */ - private $proportionalDistributor; + private ProportionalIntegerDistributorInterface $proportionalDistributor; - /** @var UnitsPromotionAdjustmentsApplicatorInterface */ - private $unitsPromotionAdjustmentsApplicator; + private UnitsPromotionAdjustmentsApplicatorInterface $unitsPromotionAdjustmentsApplicator; public function __construct( ProportionalIntegerDistributorInterface $proportionalIntegerDistributor, diff --git a/src/Sylius/Component/Core/Promotion/Action/PercentageDiscountPromotionActionCommand.php b/src/Sylius/Component/Core/Promotion/Action/PercentageDiscountPromotionActionCommand.php index 64b43832152..a572cc4edb1 100644 --- a/src/Sylius/Component/Core/Promotion/Action/PercentageDiscountPromotionActionCommand.php +++ b/src/Sylius/Component/Core/Promotion/Action/PercentageDiscountPromotionActionCommand.php @@ -25,11 +25,9 @@ final class PercentageDiscountPromotionActionCommand extends DiscountPromotionAc { public const TYPE = 'order_percentage_discount'; - /** @var ProportionalIntegerDistributorInterface */ - private $distributor; + private ProportionalIntegerDistributorInterface $distributor; - /** @var UnitsPromotionAdjustmentsApplicatorInterface */ - private $unitsPromotionAdjustmentsApplicator; + private UnitsPromotionAdjustmentsApplicatorInterface $unitsPromotionAdjustmentsApplicator; public function __construct( ProportionalIntegerDistributorInterface $distributor, diff --git a/src/Sylius/Component/Core/Promotion/Action/ShippingPercentageDiscountPromotionActionCommand.php b/src/Sylius/Component/Core/Promotion/Action/ShippingPercentageDiscountPromotionActionCommand.php index f2af988ebd6..5f813fefdea 100644 --- a/src/Sylius/Component/Core/Promotion/Action/ShippingPercentageDiscountPromotionActionCommand.php +++ b/src/Sylius/Component/Core/Promotion/Action/ShippingPercentageDiscountPromotionActionCommand.php @@ -27,8 +27,7 @@ final class ShippingPercentageDiscountPromotionActionCommand implements Promotio { public const TYPE = 'shipping_percentage_discount'; - /** @var FactoryInterface */ - private $adjustmentFactory; + private FactoryInterface $adjustmentFactory; public function __construct(FactoryInterface $adjustmentFactory) { diff --git a/src/Sylius/Component/Core/Promotion/Action/UnitDiscountPromotionActionCommand.php b/src/Sylius/Component/Core/Promotion/Action/UnitDiscountPromotionActionCommand.php index 85aaacf791e..72fe98960c6 100644 --- a/src/Sylius/Component/Core/Promotion/Action/UnitDiscountPromotionActionCommand.php +++ b/src/Sylius/Component/Core/Promotion/Action/UnitDiscountPromotionActionCommand.php @@ -26,8 +26,7 @@ abstract class UnitDiscountPromotionActionCommand implements PromotionActionCommandInterface { - /** @var FactoryInterface */ - protected $adjustmentFactory; + protected FactoryInterface $adjustmentFactory; public function __construct(FactoryInterface $adjustmentFactory) { diff --git a/src/Sylius/Component/Core/Promotion/Action/UnitFixedDiscountPromotionActionCommand.php b/src/Sylius/Component/Core/Promotion/Action/UnitFixedDiscountPromotionActionCommand.php index 4481f6a0ec2..e8449730f0a 100644 --- a/src/Sylius/Component/Core/Promotion/Action/UnitFixedDiscountPromotionActionCommand.php +++ b/src/Sylius/Component/Core/Promotion/Action/UnitFixedDiscountPromotionActionCommand.php @@ -25,14 +25,11 @@ final class UnitFixedDiscountPromotionActionCommand extends UnitDiscountPromotio { public const TYPE = 'unit_fixed_discount'; - /** @var FilterInterface */ - private $priceRangeFilter; + private FilterInterface $priceRangeFilter; - /** @var FilterInterface */ - private $taxonFilter; + private FilterInterface $taxonFilter; - /** @var FilterInterface */ - private $productFilter; + private FilterInterface $productFilter; public function __construct( FactoryInterface $adjustmentFactory, diff --git a/src/Sylius/Component/Core/Promotion/Action/UnitPercentageDiscountPromotionActionCommand.php b/src/Sylius/Component/Core/Promotion/Action/UnitPercentageDiscountPromotionActionCommand.php index 8355a7d5361..bc5dd415d22 100644 --- a/src/Sylius/Component/Core/Promotion/Action/UnitPercentageDiscountPromotionActionCommand.php +++ b/src/Sylius/Component/Core/Promotion/Action/UnitPercentageDiscountPromotionActionCommand.php @@ -25,14 +25,11 @@ final class UnitPercentageDiscountPromotionActionCommand extends UnitDiscountPro { public const TYPE = 'unit_percentage_discount'; - /** @var FilterInterface */ - private $priceRangeFilter; + private FilterInterface $priceRangeFilter; - /** @var FilterInterface */ - private $taxonFilter; + private FilterInterface $taxonFilter; - /** @var FilterInterface */ - private $productFilter; + private FilterInterface $productFilter; public function __construct( FactoryInterface $adjustmentFactory, diff --git a/src/Sylius/Component/Core/Promotion/Applicator/UnitsPromotionAdjustmentsApplicator.php b/src/Sylius/Component/Core/Promotion/Applicator/UnitsPromotionAdjustmentsApplicator.php index 72ee07b14ea..13bf757ed3c 100644 --- a/src/Sylius/Component/Core/Promotion/Applicator/UnitsPromotionAdjustmentsApplicator.php +++ b/src/Sylius/Component/Core/Promotion/Applicator/UnitsPromotionAdjustmentsApplicator.php @@ -25,11 +25,9 @@ final class UnitsPromotionAdjustmentsApplicator implements UnitsPromotionAdjustmentsApplicatorInterface { - /** @var AdjustmentFactoryInterface */ - private $adjustmentFactory; + private AdjustmentFactoryInterface $adjustmentFactory; - /** @var IntegerDistributorInterface */ - private $distributor; + private IntegerDistributorInterface $distributor; public function __construct( AdjustmentFactoryInterface $adjustmentFactory, diff --git a/src/Sylius/Component/Core/Promotion/Checker/Eligibility/PromotionCouponPerCustomerUsageLimitEligibilityChecker.php b/src/Sylius/Component/Core/Promotion/Checker/Eligibility/PromotionCouponPerCustomerUsageLimitEligibilityChecker.php index 53cd27e2fd9..88b6a6f4b1b 100644 --- a/src/Sylius/Component/Core/Promotion/Checker/Eligibility/PromotionCouponPerCustomerUsageLimitEligibilityChecker.php +++ b/src/Sylius/Component/Core/Promotion/Checker/Eligibility/PromotionCouponPerCustomerUsageLimitEligibilityChecker.php @@ -22,8 +22,7 @@ final class PromotionCouponPerCustomerUsageLimitEligibilityChecker implements PromotionCouponEligibilityCheckerInterface { - /** @var OrderRepositoryInterface */ - private $orderRepository; + private OrderRepositoryInterface $orderRepository; public function __construct(OrderRepositoryInterface $orderRepository) { diff --git a/src/Sylius/Component/Core/Promotion/Checker/Rule/ItemTotalRuleChecker.php b/src/Sylius/Component/Core/Promotion/Checker/Rule/ItemTotalRuleChecker.php index 17c431f3e41..e53f4e4cf47 100644 --- a/src/Sylius/Component/Core/Promotion/Checker/Rule/ItemTotalRuleChecker.php +++ b/src/Sylius/Component/Core/Promotion/Checker/Rule/ItemTotalRuleChecker.php @@ -20,8 +20,7 @@ final class ItemTotalRuleChecker implements RuleCheckerInterface { - /** @var RuleCheckerInterface */ - private $itemTotalRuleChecker; + private RuleCheckerInterface $itemTotalRuleChecker; public function __construct(RuleCheckerInterface $itemTotalRuleChecker) { diff --git a/src/Sylius/Component/Core/Promotion/Checker/Rule/NthOrderRuleChecker.php b/src/Sylius/Component/Core/Promotion/Checker/Rule/NthOrderRuleChecker.php index 588b7717a34..b4f756d000c 100644 --- a/src/Sylius/Component/Core/Promotion/Checker/Rule/NthOrderRuleChecker.php +++ b/src/Sylius/Component/Core/Promotion/Checker/Rule/NthOrderRuleChecker.php @@ -23,8 +23,7 @@ final class NthOrderRuleChecker implements RuleCheckerInterface { public const TYPE = 'nth_order'; - /** @var OrderRepositoryInterface */ - private $orderRepository; + private OrderRepositoryInterface $orderRepository; public function __construct(OrderRepositoryInterface $orderRepository) { diff --git a/src/Sylius/Component/Core/Promotion/Checker/Rule/ShippingCountryRuleChecker.php b/src/Sylius/Component/Core/Promotion/Checker/Rule/ShippingCountryRuleChecker.php index b3c488ec3cf..a1855bbcd2b 100644 --- a/src/Sylius/Component/Core/Promotion/Checker/Rule/ShippingCountryRuleChecker.php +++ b/src/Sylius/Component/Core/Promotion/Checker/Rule/ShippingCountryRuleChecker.php @@ -24,8 +24,7 @@ final class ShippingCountryRuleChecker implements RuleCheckerInterface { public const TYPE = 'shipping_country'; - /** @var RepositoryInterface */ - private $countryRepository; + private RepositoryInterface $countryRepository; public function __construct(RepositoryInterface $countryRepository) { diff --git a/src/Sylius/Component/Core/Promotion/Checker/Rule/TotalOfItemsFromTaxonRuleChecker.php b/src/Sylius/Component/Core/Promotion/Checker/Rule/TotalOfItemsFromTaxonRuleChecker.php index 21979d1d91f..edb61f78c3c 100644 --- a/src/Sylius/Component/Core/Promotion/Checker/Rule/TotalOfItemsFromTaxonRuleChecker.php +++ b/src/Sylius/Component/Core/Promotion/Checker/Rule/TotalOfItemsFromTaxonRuleChecker.php @@ -24,8 +24,7 @@ final class TotalOfItemsFromTaxonRuleChecker implements RuleCheckerInterface { public const TYPE = 'total_of_items_from_taxon'; - /** @var TaxonRepositoryInterface */ - private $taxonRepository; + private TaxonRepositoryInterface $taxonRepository; public function __construct(TaxonRepositoryInterface $taxonRepository) { diff --git a/src/Sylius/Component/Core/Promotion/Filter/PriceRangeFilter.php b/src/Sylius/Component/Core/Promotion/Filter/PriceRangeFilter.php index b49202ed66c..7d7fe7d0408 100644 --- a/src/Sylius/Component/Core/Promotion/Filter/PriceRangeFilter.php +++ b/src/Sylius/Component/Core/Promotion/Filter/PriceRangeFilter.php @@ -19,8 +19,7 @@ final class PriceRangeFilter implements FilterInterface { - /** @var ProductVariantPriceCalculatorInterface */ - private $productVariantPriceCalculator; + private ProductVariantPriceCalculatorInterface $productVariantPriceCalculator; public function __construct(ProductVariantPriceCalculatorInterface $productVariantPriceCalculator) { diff --git a/src/Sylius/Component/Core/Promotion/Updater/Rule/HasTaxonRuleUpdater.php b/src/Sylius/Component/Core/Promotion/Updater/Rule/HasTaxonRuleUpdater.php index da3d406f3a3..5ec9906baac 100644 --- a/src/Sylius/Component/Core/Promotion/Updater/Rule/HasTaxonRuleUpdater.php +++ b/src/Sylius/Component/Core/Promotion/Updater/Rule/HasTaxonRuleUpdater.php @@ -21,11 +21,9 @@ final class HasTaxonRuleUpdater implements TaxonAwareRuleUpdaterInterface { - /** @var RepositoryInterface */ - private $promotionRuleRepository; + private RepositoryInterface $promotionRuleRepository; - /** @var EntityManagerInterface */ - private $manager; + private EntityManagerInterface $manager; public function __construct(RepositoryInterface $promotionRuleRepository, EntityManagerInterface $manager) { diff --git a/src/Sylius/Component/Core/Promotion/Updater/Rule/TotalOfItemsFromTaxonRuleUpdater.php b/src/Sylius/Component/Core/Promotion/Updater/Rule/TotalOfItemsFromTaxonRuleUpdater.php index 5d2cca4d454..5cb335a8a2a 100644 --- a/src/Sylius/Component/Core/Promotion/Updater/Rule/TotalOfItemsFromTaxonRuleUpdater.php +++ b/src/Sylius/Component/Core/Promotion/Updater/Rule/TotalOfItemsFromTaxonRuleUpdater.php @@ -20,8 +20,7 @@ final class TotalOfItemsFromTaxonRuleUpdater implements TaxonAwareRuleUpdaterInterface { - /** @var RepositoryInterface */ - private $promotionRuleRepository; + private RepositoryInterface $promotionRuleRepository; public function __construct(RepositoryInterface $promotionRuleRepository) { diff --git a/src/Sylius/Component/Core/Provider/ActivePromotionsByChannelProvider.php b/src/Sylius/Component/Core/Provider/ActivePromotionsByChannelProvider.php index 007b7cc5a2a..f9f02c55b11 100644 --- a/src/Sylius/Component/Core/Provider/ActivePromotionsByChannelProvider.php +++ b/src/Sylius/Component/Core/Provider/ActivePromotionsByChannelProvider.php @@ -21,8 +21,7 @@ final class ActivePromotionsByChannelProvider implements PreQualifiedPromotionsProviderInterface { - /** @var PromotionRepositoryInterface */ - private $promotionRepository; + private PromotionRepositoryInterface $promotionRepository; public function __construct(PromotionRepositoryInterface $promotionRepository) { diff --git a/src/Sylius/Component/Core/Provider/ChannelBasedLocaleProvider.php b/src/Sylius/Component/Core/Provider/ChannelBasedLocaleProvider.php index 604f913d00b..ad6ae3395e5 100644 --- a/src/Sylius/Component/Core/Provider/ChannelBasedLocaleProvider.php +++ b/src/Sylius/Component/Core/Provider/ChannelBasedLocaleProvider.php @@ -21,11 +21,9 @@ final class ChannelBasedLocaleProvider implements LocaleProviderInterface { - /** @var ChannelContextInterface */ - private $channelContext; + private ChannelContextInterface $channelContext; - /** @var string */ - private $defaultLocaleCode; + private string $defaultLocaleCode; public function __construct(ChannelContextInterface $channelContext, string $defaultLocaleCode) { diff --git a/src/Sylius/Component/Core/Provider/ProductVariantsPricesProvider.php b/src/Sylius/Component/Core/Provider/ProductVariantsPricesProvider.php index 64897c77b99..0b16380932c 100644 --- a/src/Sylius/Component/Core/Provider/ProductVariantsPricesProvider.php +++ b/src/Sylius/Component/Core/Provider/ProductVariantsPricesProvider.php @@ -22,8 +22,7 @@ final class ProductVariantsPricesProvider implements ProductVariantsPricesProviderInterface { - /** @var ProductVariantPriceCalculatorInterface */ - private $productVariantPriceCalculator; + private ProductVariantPriceCalculatorInterface $productVariantPriceCalculator; public function __construct(ProductVariantPriceCalculatorInterface $productVariantPriceCalculator) { diff --git a/src/Sylius/Component/Core/Provider/TranslationLocaleProvider.php b/src/Sylius/Component/Core/Provider/TranslationLocaleProvider.php index db0a7aecae2..04632de8de4 100644 --- a/src/Sylius/Component/Core/Provider/TranslationLocaleProvider.php +++ b/src/Sylius/Component/Core/Provider/TranslationLocaleProvider.php @@ -19,11 +19,9 @@ final class TranslationLocaleProvider implements TranslationLocaleProviderInterface { - /** @var RepositoryInterface */ - private $localeRepository; + private RepositoryInterface $localeRepository; - /** @var string */ - private $defaultLocaleCode; + private string $defaultLocaleCode; public function __construct(RepositoryInterface $localeRepository, string $defaultLocaleCode) { diff --git a/src/Sylius/Component/Core/Repository/ProductRepositoryInterface.php b/src/Sylius/Component/Core/Repository/ProductRepositoryInterface.php index b498f76d1ae..656c046c6fc 100644 --- a/src/Sylius/Component/Core/Repository/ProductRepositoryInterface.php +++ b/src/Sylius/Component/Core/Repository/ProductRepositoryInterface.php @@ -21,9 +21,7 @@ interface ProductRepositoryInterface extends BaseProductRepositoryInterface { - /** - * @param mixed|null $taxonId - */ + /** @param mixed|null $taxonId */ public function createListQueryBuilder(string $locale, $taxonId = null): QueryBuilder; public function createShopListQueryBuilder( diff --git a/src/Sylius/Component/Core/Resolver/ChannelBasedPaymentMethodsResolver.php b/src/Sylius/Component/Core/Resolver/ChannelBasedPaymentMethodsResolver.php index e5162123955..87925da2140 100644 --- a/src/Sylius/Component/Core/Resolver/ChannelBasedPaymentMethodsResolver.php +++ b/src/Sylius/Component/Core/Resolver/ChannelBasedPaymentMethodsResolver.php @@ -21,8 +21,7 @@ final class ChannelBasedPaymentMethodsResolver implements PaymentMethodsResolverInterface { - /** @var PaymentMethodRepositoryInterface */ - private $paymentMethodRepository; + private PaymentMethodRepositoryInterface $paymentMethodRepository; public function __construct(PaymentMethodRepositoryInterface $paymentMethodRepository) { diff --git a/src/Sylius/Component/Core/Resolver/DefaultPaymentMethodResolver.php b/src/Sylius/Component/Core/Resolver/DefaultPaymentMethodResolver.php index c80ea04f521..47d2770e13c 100644 --- a/src/Sylius/Component/Core/Resolver/DefaultPaymentMethodResolver.php +++ b/src/Sylius/Component/Core/Resolver/DefaultPaymentMethodResolver.php @@ -24,8 +24,7 @@ class DefaultPaymentMethodResolver implements DefaultPaymentMethodResolverInterface { - /** @var PaymentMethodRepositoryInterface */ - protected $paymentMethodRepository; + protected PaymentMethodRepositoryInterface $paymentMethodRepository; public function __construct(PaymentMethodRepositoryInterface $paymentMethodRepository) { diff --git a/src/Sylius/Component/Core/Resolver/DefaultShippingMethodResolver.php b/src/Sylius/Component/Core/Resolver/DefaultShippingMethodResolver.php index 11bae682898..4b722cc31d0 100644 --- a/src/Sylius/Component/Core/Resolver/DefaultShippingMethodResolver.php +++ b/src/Sylius/Component/Core/Resolver/DefaultShippingMethodResolver.php @@ -26,8 +26,7 @@ class DefaultShippingMethodResolver implements DefaultShippingMethodResolverInterface { - /** @var ShippingMethodRepositoryInterface */ - private $shippingMethodRepository; + private ShippingMethodRepositoryInterface $shippingMethodRepository; public function __construct(ShippingMethodRepositoryInterface $shippingMethodRepository) { diff --git a/src/Sylius/Component/Core/Resolver/EligibleDefaultShippingMethodResolver.php b/src/Sylius/Component/Core/Resolver/EligibleDefaultShippingMethodResolver.php index 92729173722..4d1a9913986 100644 --- a/src/Sylius/Component/Core/Resolver/EligibleDefaultShippingMethodResolver.php +++ b/src/Sylius/Component/Core/Resolver/EligibleDefaultShippingMethodResolver.php @@ -29,14 +29,11 @@ final class EligibleDefaultShippingMethodResolver implements DefaultShippingMethodResolverInterface { - /** @var ShippingMethodRepositoryInterface */ - private $shippingMethodRepository; + private ShippingMethodRepositoryInterface $shippingMethodRepository; - /** @var ShippingMethodEligibilityCheckerInterface */ - private $shippingMethodEligibilityChecker; + private ShippingMethodEligibilityCheckerInterface $shippingMethodEligibilityChecker; - /** @var ZoneMatcherInterface */ - private $zoneMatcher; + private ZoneMatcherInterface $zoneMatcher; public function __construct( ShippingMethodRepositoryInterface $shippingMethodRepository, diff --git a/src/Sylius/Component/Core/Resolver/ZoneAndChannelBasedShippingMethodsResolver.php b/src/Sylius/Component/Core/Resolver/ZoneAndChannelBasedShippingMethodsResolver.php index 3a36aa6763c..057b7c9d002 100644 --- a/src/Sylius/Component/Core/Resolver/ZoneAndChannelBasedShippingMethodsResolver.php +++ b/src/Sylius/Component/Core/Resolver/ZoneAndChannelBasedShippingMethodsResolver.php @@ -25,14 +25,11 @@ class ZoneAndChannelBasedShippingMethodsResolver implements ShippingMethodsResolverInterface { - /** @var ShippingMethodRepositoryInterface */ - private $shippingMethodRepository; + private ShippingMethodRepositoryInterface $shippingMethodRepository; - /** @var ZoneMatcherInterface */ - private $zoneMatcher; + private ZoneMatcherInterface $zoneMatcher; - /** @var ShippingMethodEligibilityCheckerInterface */ - private $eligibilityChecker; + private ShippingMethodEligibilityCheckerInterface $eligibilityChecker; public function __construct( ShippingMethodRepositoryInterface $shippingMethodRepository, diff --git a/src/Sylius/Component/Core/StateResolver/CheckoutStateResolver.php b/src/Sylius/Component/Core/StateResolver/CheckoutStateResolver.php index b2fdd7e5909..4add18b1789 100644 --- a/src/Sylius/Component/Core/StateResolver/CheckoutStateResolver.php +++ b/src/Sylius/Component/Core/StateResolver/CheckoutStateResolver.php @@ -22,14 +22,11 @@ final class CheckoutStateResolver implements StateResolverInterface { - /** @var FactoryInterface */ - private $stateMachineFactory; + private FactoryInterface $stateMachineFactory; - /** @var OrderPaymentMethodSelectionRequirementCheckerInterface */ - private $orderPaymentMethodSelectionRequirementChecker; + private OrderPaymentMethodSelectionRequirementCheckerInterface $orderPaymentMethodSelectionRequirementChecker; - /** @var OrderShippingMethodSelectionRequirementCheckerInterface */ - private $orderShippingMethodSelectionRequirementChecker; + private OrderShippingMethodSelectionRequirementCheckerInterface $orderShippingMethodSelectionRequirementChecker; public function __construct( FactoryInterface $stateMachineFactory, diff --git a/src/Sylius/Component/Core/StateResolver/OrderPaymentStateResolver.php b/src/Sylius/Component/Core/StateResolver/OrderPaymentStateResolver.php index 62281a3dd09..af04a3393d7 100644 --- a/src/Sylius/Component/Core/StateResolver/OrderPaymentStateResolver.php +++ b/src/Sylius/Component/Core/StateResolver/OrderPaymentStateResolver.php @@ -25,8 +25,7 @@ final class OrderPaymentStateResolver implements StateResolverInterface { - /** @var FactoryInterface */ - private $stateMachineFactory; + private FactoryInterface $stateMachineFactory; public function __construct(FactoryInterface $stateMachineFactory) { diff --git a/src/Sylius/Component/Core/StateResolver/OrderShippingStateResolver.php b/src/Sylius/Component/Core/StateResolver/OrderShippingStateResolver.php index 3f0abdc5863..bee7c0cd112 100644 --- a/src/Sylius/Component/Core/StateResolver/OrderShippingStateResolver.php +++ b/src/Sylius/Component/Core/StateResolver/OrderShippingStateResolver.php @@ -25,8 +25,7 @@ final class OrderShippingStateResolver implements StateResolverInterface { - /** @var FactoryInterface */ - private $stateMachineFactory; + private FactoryInterface $stateMachineFactory; public function __construct(FactoryInterface $stateMachineFactory) { diff --git a/src/Sylius/Component/Core/StateResolver/OrderStateResolver.php b/src/Sylius/Component/Core/StateResolver/OrderStateResolver.php index 94832cf30be..babdf988544 100644 --- a/src/Sylius/Component/Core/StateResolver/OrderStateResolver.php +++ b/src/Sylius/Component/Core/StateResolver/OrderStateResolver.php @@ -23,8 +23,7 @@ final class OrderStateResolver implements StateResolverInterface { - /** @var FactoryInterface */ - private $stateMachineFactory; + private FactoryInterface $stateMachineFactory; public function __construct(FactoryInterface $stateMachineFactory) { diff --git a/src/Sylius/Component/Core/Taxation/Applicator/OrderItemUnitsTaxesApplicator.php b/src/Sylius/Component/Core/Taxation/Applicator/OrderItemUnitsTaxesApplicator.php index bb9ed0c8c12..603ae481e49 100644 --- a/src/Sylius/Component/Core/Taxation/Applicator/OrderItemUnitsTaxesApplicator.php +++ b/src/Sylius/Component/Core/Taxation/Applicator/OrderItemUnitsTaxesApplicator.php @@ -24,14 +24,11 @@ class OrderItemUnitsTaxesApplicator implements OrderTaxesApplicatorInterface { - /** @var CalculatorInterface */ - private $calculator; + private CalculatorInterface $calculator; - /** @var AdjustmentFactoryInterface */ - private $adjustmentFactory; + private AdjustmentFactoryInterface $adjustmentFactory; - /** @var TaxRateResolverInterface */ - private $taxRateResolver; + private TaxRateResolverInterface $taxRateResolver; public function __construct( CalculatorInterface $calculator, diff --git a/src/Sylius/Component/Core/Taxation/Applicator/OrderItemsTaxesApplicator.php b/src/Sylius/Component/Core/Taxation/Applicator/OrderItemsTaxesApplicator.php index 1efdbd76a24..be62e68319f 100644 --- a/src/Sylius/Component/Core/Taxation/Applicator/OrderItemsTaxesApplicator.php +++ b/src/Sylius/Component/Core/Taxation/Applicator/OrderItemsTaxesApplicator.php @@ -26,17 +26,13 @@ class OrderItemsTaxesApplicator implements OrderTaxesApplicatorInterface { - /** @var CalculatorInterface */ - private $calculator; + private CalculatorInterface $calculator; - /** @var AdjustmentFactoryInterface */ - private $adjustmentFactory; + private AdjustmentFactoryInterface $adjustmentFactory; - /** @var IntegerDistributorInterface */ - private $distributor; + private IntegerDistributorInterface $distributor; - /** @var TaxRateResolverInterface */ - private $taxRateResolver; + private TaxRateResolverInterface $taxRateResolver; public function __construct( CalculatorInterface $calculator, diff --git a/src/Sylius/Component/Core/Taxation/Applicator/OrderShipmentTaxesApplicator.php b/src/Sylius/Component/Core/Taxation/Applicator/OrderShipmentTaxesApplicator.php index 430d69ad6a0..2528c4d3923 100644 --- a/src/Sylius/Component/Core/Taxation/Applicator/OrderShipmentTaxesApplicator.php +++ b/src/Sylius/Component/Core/Taxation/Applicator/OrderShipmentTaxesApplicator.php @@ -26,14 +26,11 @@ class OrderShipmentTaxesApplicator implements OrderTaxesApplicatorInterface { - /** @var CalculatorInterface */ - private $calculator; + private CalculatorInterface $calculator; - /** @var AdjustmentFactoryInterface */ - private $adjustmentFactory; + private AdjustmentFactoryInterface $adjustmentFactory; - /** @var TaxRateResolverInterface */ - private $taxRateResolver; + private TaxRateResolverInterface $taxRateResolver; public function __construct( CalculatorInterface $calculator, diff --git a/src/Sylius/Component/Core/Test/Factory/TestPromotionFactory.php b/src/Sylius/Component/Core/Test/Factory/TestPromotionFactory.php index 3747de361a3..42ba5230b9f 100644 --- a/src/Sylius/Component/Core/Test/Factory/TestPromotionFactory.php +++ b/src/Sylius/Component/Core/Test/Factory/TestPromotionFactory.php @@ -20,8 +20,7 @@ final class TestPromotionFactory implements TestPromotionFactoryInterface { - /** @var FactoryInterface */ - private $promotionFactory; + private FactoryInterface $promotionFactory; public function __construct(FactoryInterface $promotionFactory) { diff --git a/src/Sylius/Component/Core/Test/Services/DefaultChannelFactory.php b/src/Sylius/Component/Core/Test/Services/DefaultChannelFactory.php index a0e84c405ab..208aba2f2e5 100644 --- a/src/Sylius/Component/Core/Test/Services/DefaultChannelFactory.php +++ b/src/Sylius/Component/Core/Test/Services/DefaultChannelFactory.php @@ -28,26 +28,19 @@ final class DefaultChannelFactory implements DefaultChannelFactoryInterface public const DEFAULT_CHANNEL_CURRENCY = 'USD'; - /** @var ChannelFactoryInterface */ - private $channelFactory; + private ChannelFactoryInterface $channelFactory; - /** @var FactoryInterface */ - private $currencyFactory; + private FactoryInterface $currencyFactory; - /** @var FactoryInterface */ - private $localeFactory; + private FactoryInterface $localeFactory; - /** @var RepositoryInterface */ - private $channelRepository; + private RepositoryInterface $channelRepository; - /** @var RepositoryInterface */ - private $currencyRepository; + private RepositoryInterface $currencyRepository; - /** @var RepositoryInterface */ - private $localeRepository; + private RepositoryInterface $localeRepository; - /** @var string */ - private $defaultLocaleCode; + private string $defaultLocaleCode; public function __construct( ChannelFactoryInterface $channelFactory, diff --git a/src/Sylius/Component/Core/Test/Services/DefaultUnitedStatesChannelFactory.php b/src/Sylius/Component/Core/Test/Services/DefaultUnitedStatesChannelFactory.php index fe5ddc07dad..8f7a1facdf7 100644 --- a/src/Sylius/Component/Core/Test/Services/DefaultUnitedStatesChannelFactory.php +++ b/src/Sylius/Component/Core/Test/Services/DefaultUnitedStatesChannelFactory.php @@ -37,38 +37,27 @@ final class DefaultUnitedStatesChannelFactory implements DefaultChannelFactoryIn public const DEFAULT_CHANNEL_NAME = 'United States'; - /** @var RepositoryInterface */ - private $channelRepository; + private RepositoryInterface $channelRepository; - /** @var RepositoryInterface */ - private $countryRepository; + private RepositoryInterface $countryRepository; - /** @var RepositoryInterface */ - private $currencyRepository; + private RepositoryInterface $currencyRepository; - /** @var RepositoryInterface */ - private $localeRepository; + private RepositoryInterface $localeRepository; - /** @var RepositoryInterface */ - private $zoneRepository; + private RepositoryInterface $zoneRepository; - /** @var ChannelFactoryInterface */ - private $channelFactory; + private ChannelFactoryInterface $channelFactory; - /** @var FactoryInterface */ - private $countryFactory; + private FactoryInterface $countryFactory; - /** @var FactoryInterface */ - private $currencyFactory; + private FactoryInterface $currencyFactory; - /** @var FactoryInterface */ - private $localeFactory; + private FactoryInterface $localeFactory; - /** @var ZoneFactoryInterface */ - private $zoneFactory; + private ZoneFactoryInterface $zoneFactory; - /** @var string */ - private $defaultLocaleCode; + private string $defaultLocaleCode; public function __construct( RepositoryInterface $channelRepository, diff --git a/src/Sylius/Component/Core/Test/Services/EmailChecker.php b/src/Sylius/Component/Core/Test/Services/EmailChecker.php index 96d27234337..ce15f9efefc 100644 --- a/src/Sylius/Component/Core/Test/Services/EmailChecker.php +++ b/src/Sylius/Component/Core/Test/Services/EmailChecker.php @@ -19,8 +19,7 @@ final class EmailChecker implements EmailCheckerInterface { - /** @var string */ - private $spoolDirectory; + private string $spoolDirectory; public function __construct(string $spoolDirectory) { diff --git a/src/Sylius/Component/Core/TokenAssigner/UniqueIdBasedOrderTokenAssigner.php b/src/Sylius/Component/Core/TokenAssigner/UniqueIdBasedOrderTokenAssigner.php index ab42683b268..0a2c4873e90 100644 --- a/src/Sylius/Component/Core/TokenAssigner/UniqueIdBasedOrderTokenAssigner.php +++ b/src/Sylius/Component/Core/TokenAssigner/UniqueIdBasedOrderTokenAssigner.php @@ -18,8 +18,7 @@ final class UniqueIdBasedOrderTokenAssigner implements OrderTokenAssignerInterface { - /** @var RandomnessGeneratorInterface */ - private $generator; + private RandomnessGeneratorInterface $generator; public function __construct(RandomnessGeneratorInterface $generator) { diff --git a/src/Sylius/Component/Core/Translation/TranslatableEntityLocaleAssigner.php b/src/Sylius/Component/Core/Translation/TranslatableEntityLocaleAssigner.php index 9a9e26ecedf..db633baf9fd 100644 --- a/src/Sylius/Component/Core/Translation/TranslatableEntityLocaleAssigner.php +++ b/src/Sylius/Component/Core/Translation/TranslatableEntityLocaleAssigner.php @@ -21,11 +21,9 @@ final class TranslatableEntityLocaleAssigner implements TranslatableEntityLocaleAssignerInterface { - /** @var LocaleContextInterface */ - private $localeContext; + private LocaleContextInterface $localeContext; - /** @var TranslationLocaleProviderInterface */ - private $translationLocaleProvider; + private TranslationLocaleProviderInterface $translationLocaleProvider; public function __construct( LocaleContextInterface $localeContext, diff --git a/src/Sylius/Component/Core/Updater/UnpaidOrdersStateUpdater.php b/src/Sylius/Component/Core/Updater/UnpaidOrdersStateUpdater.php index 55b7b957993..6a3baf80e38 100644 --- a/src/Sylius/Component/Core/Updater/UnpaidOrdersStateUpdater.php +++ b/src/Sylius/Component/Core/Updater/UnpaidOrdersStateUpdater.php @@ -22,25 +22,18 @@ final class UnpaidOrdersStateUpdater implements UnpaidOrdersStateUpdaterInterface { - /** @var OrderRepositoryInterface */ - private $orderRepository; + private OrderRepositoryInterface $orderRepository; - /** @var Factory */ - private $stateMachineFactory; + private Factory $stateMachineFactory; - /** @var string */ - private $expirationPeriod; + private string $expirationPeriod; - /** @var LoggerInterface|null */ - private $logger; + private ?LoggerInterface $logger; - /** - * @param string $expirationPeriod - */ public function __construct( OrderRepositoryInterface $orderRepository, Factory $stateMachineFactory, - $expirationPeriod, + string $expirationPeriod, LoggerInterface $logger = null ) { $this->orderRepository = $orderRepository; diff --git a/src/Sylius/Component/Core/Uploader/ImageUploader.php b/src/Sylius/Component/Core/Uploader/ImageUploader.php index f5a989d6da9..04eeb1b380a 100644 --- a/src/Sylius/Component/Core/Uploader/ImageUploader.php +++ b/src/Sylius/Component/Core/Uploader/ImageUploader.php @@ -22,11 +22,9 @@ class ImageUploader implements ImageUploaderInterface { - /** @var Filesystem */ - protected $filesystem; + protected Filesystem $filesystem; - /** @var ImagePathGeneratorInterface */ - protected $imagePathGenerator; + protected ImagePathGeneratorInterface $imagePathGenerator; public function __construct( Filesystem $filesystem, diff --git a/src/Sylius/Component/Core/spec/Model/OrderSpec.php b/src/Sylius/Component/Core/spec/Model/OrderSpec.php index a0ba570eef6..66918659b5f 100644 --- a/src/Sylius/Component/Core/spec/Model/OrderSpec.php +++ b/src/Sylius/Component/Core/spec/Model/OrderSpec.php @@ -16,9 +16,9 @@ use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use PhpSpec\ObjectBehavior; -use Sylius\Component\Channel\Model\ChannelInterface; use Sylius\Component\Core\Model\AddressInterface; use Sylius\Component\Core\Model\AdjustmentInterface; +use Sylius\Component\Core\Model\ChannelInterface; use Sylius\Component\Core\Model\CustomerInterface; use Sylius\Component\Core\Model\OrderItemInterface; use Sylius\Component\Core\Model\PaymentInterface; diff --git a/src/Sylius/Component/Currency/Context/CompositeCurrencyContext.php b/src/Sylius/Component/Currency/Context/CompositeCurrencyContext.php index 93a659f4b28..9bb2ebf9dab 100644 --- a/src/Sylius/Component/Currency/Context/CompositeCurrencyContext.php +++ b/src/Sylius/Component/Currency/Context/CompositeCurrencyContext.php @@ -22,7 +22,7 @@ final class CompositeCurrencyContext implements CurrencyContextInterface * * @psalm-var PriorityQueue */ - private $currencyContexts; + private PriorityQueue $currencyContexts; public function __construct() { diff --git a/src/Sylius/Component/Currency/Converter/CurrencyConverter.php b/src/Sylius/Component/Currency/Converter/CurrencyConverter.php index 5c864609542..3628ba86229 100644 --- a/src/Sylius/Component/Currency/Converter/CurrencyConverter.php +++ b/src/Sylius/Component/Currency/Converter/CurrencyConverter.php @@ -18,11 +18,10 @@ final class CurrencyConverter implements CurrencyConverterInterface { - /** @var ExchangeRateRepositoryInterface */ - private $exchangeRateRepository; + private ExchangeRateRepositoryInterface $exchangeRateRepository; /** @var array|ExchangeRateInterface[] */ - private $cache; + private ?array $cache = null; public function __construct(ExchangeRateRepositoryInterface $exchangeRateRepository) { diff --git a/src/Sylius/Component/Currency/Model/Currency.php b/src/Sylius/Component/Currency/Model/Currency.php index f1f31076783..65f1a61301f 100644 --- a/src/Sylius/Component/Currency/Model/Currency.php +++ b/src/Sylius/Component/Currency/Model/Currency.php @@ -23,8 +23,7 @@ class Currency implements CurrencyInterface /** @var mixed */ protected $id; - /** @var string|null */ - protected $code; + protected ?string $code = null; public function __construct() { diff --git a/src/Sylius/Component/Currency/Model/ExchangeRate.php b/src/Sylius/Component/Currency/Model/ExchangeRate.php index ab5feb3933e..ae20f97d3da 100644 --- a/src/Sylius/Component/Currency/Model/ExchangeRate.php +++ b/src/Sylius/Component/Currency/Model/ExchangeRate.php @@ -22,14 +22,11 @@ class ExchangeRate implements ExchangeRateInterface /** @var mixed */ protected $id; - /** @var float|null */ - protected $ratio; + protected ?float $ratio = null; - /** @var CurrencyInterface|null */ - protected $sourceCurrency; + protected ?CurrencyInterface $sourceCurrency = null; - /** @var CurrencyInterface|null */ - protected $targetCurrency; + protected ?CurrencyInterface $targetCurrency = null; public function __construct() { @@ -41,6 +38,10 @@ public function getId() return $this->id; } + /** + * @psalm-suppress TypeDoesNotContainType + * @psalm-suppress RedundantCondition + */ public function getRatio(): ?float { /** diff --git a/src/Sylius/Component/Customer/Model/Customer.php b/src/Sylius/Component/Customer/Model/Customer.php index 9fa16770339..2983e535999 100644 --- a/src/Sylius/Component/Customer/Model/Customer.php +++ b/src/Sylius/Component/Customer/Model/Customer.php @@ -22,32 +22,23 @@ class Customer implements CustomerInterface /** @var mixed */ protected $id; - /** @var string|null */ - protected $email; + protected ?string $email = null; - /** @var string|null */ - protected $emailCanonical; + protected ?string $emailCanonical = null; - /** @var string|null */ - protected $firstName; + protected ?string $firstName = null; - /** @var string|null */ - protected $lastName; + protected ?string $lastName = null; - /** @var \DateTimeInterface|null */ - protected $birthday; + protected ?\DateTimeInterface $birthday = null; - /** @var string */ - protected $gender = CustomerInterface::UNKNOWN_GENDER; + protected ?string $gender = CustomerInterface::UNKNOWN_GENDER; - /** @var CustomerGroupInterface|null */ - protected $group; + protected ?CustomerGroupInterface $group = null; - /** @var string|null */ - protected $phoneNumber; + protected ?string $phoneNumber = null; - /** @var bool */ - protected $subscribedToNewsletter = false; + protected bool $subscribedToNewsletter = false; public function __construct() { diff --git a/src/Sylius/Component/Customer/Model/CustomerGroup.php b/src/Sylius/Component/Customer/Model/CustomerGroup.php index 270b900ad3e..c91d6acca4b 100644 --- a/src/Sylius/Component/Customer/Model/CustomerGroup.php +++ b/src/Sylius/Component/Customer/Model/CustomerGroup.php @@ -18,11 +18,9 @@ class CustomerGroup implements CustomerGroupInterface /** @var mixed */ protected $id; - /** @var string|null */ - protected $code; + protected ?string $code = null; - /** @var string|null */ - protected $name; + protected ?string $name = null; public function __toString(): string { diff --git a/src/Sylius/Component/Inventory/Model/InventoryUnit.php b/src/Sylius/Component/Inventory/Model/InventoryUnit.php index a5c62a1ce93..e858ab3439d 100644 --- a/src/Sylius/Component/Inventory/Model/InventoryUnit.php +++ b/src/Sylius/Component/Inventory/Model/InventoryUnit.php @@ -18,8 +18,7 @@ class InventoryUnit implements InventoryUnitInterface /** @var mixed */ protected $id; - /** @var StockableInterface|null */ - protected $stockable; + protected ?StockableInterface $stockable = null; public function getId() { diff --git a/src/Sylius/Component/Locale/Context/CompositeLocaleContext.php b/src/Sylius/Component/Locale/Context/CompositeLocaleContext.php index 37f3b39434a..f9f23e5559f 100644 --- a/src/Sylius/Component/Locale/Context/CompositeLocaleContext.php +++ b/src/Sylius/Component/Locale/Context/CompositeLocaleContext.php @@ -22,7 +22,7 @@ final class CompositeLocaleContext implements LocaleContextInterface * * @psalm-var PriorityQueue */ - private $localeContexts; + private PriorityQueue $localeContexts; public function __construct() { diff --git a/src/Sylius/Component/Locale/Context/ImmutableLocaleContext.php b/src/Sylius/Component/Locale/Context/ImmutableLocaleContext.php index 5e82bc8d88e..d2e2c1c45cc 100644 --- a/src/Sylius/Component/Locale/Context/ImmutableLocaleContext.php +++ b/src/Sylius/Component/Locale/Context/ImmutableLocaleContext.php @@ -15,8 +15,7 @@ final class ImmutableLocaleContext implements LocaleContextInterface { - /** @var string */ - private $localeCode; + private string $localeCode; public function __construct(string $localeCode) { diff --git a/src/Sylius/Component/Locale/Context/ProviderBasedLocaleContext.php b/src/Sylius/Component/Locale/Context/ProviderBasedLocaleContext.php index 4c97a7763f1..a8ec9775e1f 100644 --- a/src/Sylius/Component/Locale/Context/ProviderBasedLocaleContext.php +++ b/src/Sylius/Component/Locale/Context/ProviderBasedLocaleContext.php @@ -17,8 +17,7 @@ final class ProviderBasedLocaleContext implements LocaleContextInterface { - /** @var LocaleProviderInterface */ - private $localeProvider; + private LocaleProviderInterface $localeProvider; public function __construct(LocaleProviderInterface $localeProvider) { diff --git a/src/Sylius/Component/Locale/Model/Locale.php b/src/Sylius/Component/Locale/Model/Locale.php index 4330fcf62b4..fa3774bbad4 100644 --- a/src/Sylius/Component/Locale/Model/Locale.php +++ b/src/Sylius/Component/Locale/Model/Locale.php @@ -20,11 +20,10 @@ class Locale implements LocaleInterface { use TimestampableTrait; - /** @var int */ - protected $id; + /** @var mixed */ + protected $id = null; - /** @var string|null */ - protected $code; + protected ?string $code = null; public function __construct() { diff --git a/src/Sylius/Component/Locale/Provider/LocaleProvider.php b/src/Sylius/Component/Locale/Provider/LocaleProvider.php index 4eddc394df5..4feeb422219 100644 --- a/src/Sylius/Component/Locale/Provider/LocaleProvider.php +++ b/src/Sylius/Component/Locale/Provider/LocaleProvider.php @@ -18,11 +18,9 @@ final class LocaleProvider implements LocaleProviderInterface { - /** @var RepositoryInterface */ - private $localeRepository; + private RepositoryInterface $localeRepository; - /** @var string */ - private $defaultLocaleCode; + private string $defaultLocaleCode; public function __construct(RepositoryInterface $localeRepository, string $defaultLocaleCode) { diff --git a/src/Sylius/Component/Order/Context/CartContext.php b/src/Sylius/Component/Order/Context/CartContext.php index 7bd4f5bf6df..7e88fa00afe 100644 --- a/src/Sylius/Component/Order/Context/CartContext.php +++ b/src/Sylius/Component/Order/Context/CartContext.php @@ -18,8 +18,7 @@ final class CartContext implements CartContextInterface { - /** @var FactoryInterface */ - private $cartFactory; + private FactoryInterface $cartFactory; public function __construct(FactoryInterface $cartFactory) { diff --git a/src/Sylius/Component/Order/Context/CompositeCartContext.php b/src/Sylius/Component/Order/Context/CompositeCartContext.php index 26477011d27..b6630af0dc5 100644 --- a/src/Sylius/Component/Order/Context/CompositeCartContext.php +++ b/src/Sylius/Component/Order/Context/CompositeCartContext.php @@ -23,7 +23,7 @@ final class CompositeCartContext implements CartContextInterface * * @psalm-var PriorityQueue */ - private $cartContexts; + private PriorityQueue $cartContexts; public function __construct() { diff --git a/src/Sylius/Component/Order/Factory/AdjustmentFactory.php b/src/Sylius/Component/Order/Factory/AdjustmentFactory.php index 1759947f283..917be22a870 100644 --- a/src/Sylius/Component/Order/Factory/AdjustmentFactory.php +++ b/src/Sylius/Component/Order/Factory/AdjustmentFactory.php @@ -18,8 +18,7 @@ class AdjustmentFactory implements AdjustmentFactoryInterface { - /** @var FactoryInterface */ - private $adjustmentFactory; + private FactoryInterface $adjustmentFactory; public function __construct(FactoryInterface $adjustmentFactory) { diff --git a/src/Sylius/Component/Order/Model/Adjustment.php b/src/Sylius/Component/Order/Model/Adjustment.php index 14378950c22..1a129bacc12 100644 --- a/src/Sylius/Component/Order/Model/Adjustment.php +++ b/src/Sylius/Component/Order/Model/Adjustment.php @@ -22,35 +22,25 @@ class Adjustment implements AdjustmentInterface /** @var mixed */ protected $id; - /** @var OrderInterface|null */ - protected $order; + protected ?OrderInterface $order = null; - /** @var OrderItemInterface|null */ - protected $orderItem; + protected ?OrderItemInterface $orderItem = null; - /** @var OrderItemUnitInterface|null */ - protected $orderItemUnit; + protected ?OrderItemUnitInterface $orderItemUnit = null; - /** @var string|null */ - protected $type; + protected ?string $type = null; - /** @var string|null */ - protected $label; + protected ?string $label = null; - /** @var int */ - protected $amount = 0; + protected int $amount = 0; - /** @var bool */ - protected $neutral = false; + protected bool $neutral = false; - /** @var bool */ - protected $locked = false; + protected bool $locked = false; - /** @var string|null */ - protected $originCode; + protected ?string $originCode = null; - /** @var array */ - protected $details = []; + protected array $details = []; public function __construct() { diff --git a/src/Sylius/Component/Order/Model/Order.php b/src/Sylius/Component/Order/Model/Order.php index 3074750c36c..a9ae5c13b4f 100644 --- a/src/Sylius/Component/Order/Model/Order.php +++ b/src/Sylius/Component/Order/Model/Order.php @@ -24,51 +24,40 @@ class Order implements OrderInterface /** @var mixed */ protected $id; - /** @var \DateTimeInterface|null */ - protected $checkoutCompletedAt; + protected ?\DateTimeInterface $checkoutCompletedAt = null; - /** @var string|null */ - protected $number; + protected ?string $number = null; - /** @var string|null */ - protected $notes; + protected ?string $notes = null; /** * @var Collection|OrderItemInterface[] * * @psalm-var Collection */ - protected $items; + protected Collection $items; - /** @var int */ - protected $itemsTotal = 0; + protected int $itemsTotal = 0; /** * @var Collection|AdjustmentInterface[] * * @psalm-var Collection */ - protected $adjustments; + protected Collection $adjustments; - /** @var int */ - protected $adjustmentsTotal = 0; + protected int $adjustmentsTotal = 0; /** * Items total + adjustments total. - * - * @var int */ - protected $total = 0; + protected int $total = 0; - /** @var string */ - protected $state = OrderInterface::STATE_CART; + protected string $state = OrderInterface::STATE_CART; public function __construct() { - /** @var ArrayCollection $this->items */ $this->items = new ArrayCollection(); - - /** @var ArrayCollection $this->adjustments */ $this->adjustments = new ArrayCollection(); $this->createdAt = new \DateTime(); diff --git a/src/Sylius/Component/Order/Model/OrderItem.php b/src/Sylius/Component/Order/Model/OrderItem.php index cc9b71e2c6d..5bc48c2e19f 100644 --- a/src/Sylius/Component/Order/Model/OrderItem.php +++ b/src/Sylius/Component/Order/Model/OrderItem.php @@ -21,47 +21,37 @@ class OrderItem implements OrderItemInterface /** @var mixed */ protected $id; - /** @var OrderInterface|null */ - protected $order; + protected ?OrderInterface $order = null; - /** @var int */ - protected $quantity = 0; + protected int $quantity = 0; - /** @var int */ - protected $unitPrice = 0; + protected int $unitPrice = 0; - /** @var int */ - protected $total = 0; + protected int $total = 0; - /** @var bool */ - protected $immutable = false; + protected bool $immutable = false; /** * @var Collection|OrderItemUnitInterface[] * * @psalm-var Collection */ - protected $units; + protected Collection $units; - /** @var int */ - protected $unitsTotal = 0; + protected int $unitsTotal = 0; /** * @var Collection|AdjustmentInterface[] * * @psalm-var Collection */ - protected $adjustments; + protected Collection $adjustments; - /** @var int */ - protected $adjustmentsTotal = 0; + protected int $adjustmentsTotal = 0; public function __construct() { - /** @var ArrayCollection $this->adjustments */ $this->adjustments = new ArrayCollection(); - - /** @var ArrayCollection $this->units */ $this->units = new ArrayCollection(); } diff --git a/src/Sylius/Component/Order/Model/OrderItemUnit.php b/src/Sylius/Component/Order/Model/OrderItemUnit.php index 069a074134e..0a1a1507105 100644 --- a/src/Sylius/Component/Order/Model/OrderItemUnit.php +++ b/src/Sylius/Component/Order/Model/OrderItemUnit.php @@ -18,25 +18,22 @@ class OrderItemUnit implements OrderItemUnitInterface { - /** @var int */ - protected $id; + /** @var mixed */ + protected $id = null; - /** @var OrderItemInterface */ - protected $orderItem; + protected OrderItemInterface $orderItem; /** * @var Collection|AdjustmentInterface[] * * @psalm-var Collection */ - protected $adjustments; + protected Collection $adjustments; - /** @var int */ - protected $adjustmentsTotal = 0; + protected int $adjustmentsTotal = 0; public function __construct(OrderItemInterface $orderItem) { - /** @var ArrayCollection $this->adjustments */ $this->adjustments = new ArrayCollection(); $this->orderItem = $orderItem; diff --git a/src/Sylius/Component/Order/Model/OrderSequence.php b/src/Sylius/Component/Order/Model/OrderSequence.php index 678c5a8d74a..c3623e9073b 100644 --- a/src/Sylius/Component/Order/Model/OrderSequence.php +++ b/src/Sylius/Component/Order/Model/OrderSequence.php @@ -18,8 +18,7 @@ class OrderSequence implements OrderSequenceInterface /** @var mixed */ protected $id; - /** @var int */ - protected $index = 0; + protected int $index = 0; public function getId() { diff --git a/src/Sylius/Component/Order/Modifier/OrderItemQuantityModifier.php b/src/Sylius/Component/Order/Modifier/OrderItemQuantityModifier.php index ebd48b61d2c..eb5335221f0 100644 --- a/src/Sylius/Component/Order/Modifier/OrderItemQuantityModifier.php +++ b/src/Sylius/Component/Order/Modifier/OrderItemQuantityModifier.php @@ -18,8 +18,7 @@ class OrderItemQuantityModifier implements OrderItemQuantityModifierInterface { - /** @var OrderItemUnitFactoryInterface */ - private $orderItemUnitFactory; + private OrderItemUnitFactoryInterface $orderItemUnitFactory; public function __construct(OrderItemUnitFactoryInterface $orderItemUnitFactory) { diff --git a/src/Sylius/Component/Order/Modifier/OrderModifier.php b/src/Sylius/Component/Order/Modifier/OrderModifier.php index 9a96572ab22..cfb02c54554 100644 --- a/src/Sylius/Component/Order/Modifier/OrderModifier.php +++ b/src/Sylius/Component/Order/Modifier/OrderModifier.php @@ -19,11 +19,9 @@ final class OrderModifier implements OrderModifierInterface { - /** @var OrderProcessorInterface */ - private $orderProcessor; + private OrderProcessorInterface $orderProcessor; - /** @var OrderItemQuantityModifierInterface */ - private $orderItemQuantityModifier; + private OrderItemQuantityModifierInterface $orderItemQuantityModifier; public function __construct( OrderProcessorInterface $orderProcessor, diff --git a/src/Sylius/Component/Order/Processor/CompositeOrderProcessor.php b/src/Sylius/Component/Order/Processor/CompositeOrderProcessor.php index e6bf7f1c868..80e4ea3a3e3 100644 --- a/src/Sylius/Component/Order/Processor/CompositeOrderProcessor.php +++ b/src/Sylius/Component/Order/Processor/CompositeOrderProcessor.php @@ -23,7 +23,7 @@ final class CompositeOrderProcessor implements OrderProcessorInterface * * @psalm-var PriorityQueue */ - private $orderProcessors; + private PriorityQueue $orderProcessors; public function __construct() { diff --git a/src/Sylius/Component/Payment/Factory/PaymentFactory.php b/src/Sylius/Component/Payment/Factory/PaymentFactory.php index 75a628a999d..b13e3ccf5cb 100644 --- a/src/Sylius/Component/Payment/Factory/PaymentFactory.php +++ b/src/Sylius/Component/Payment/Factory/PaymentFactory.php @@ -18,8 +18,7 @@ final class PaymentFactory implements PaymentFactoryInterface { - /** @var FactoryInterface */ - private $factory; + private FactoryInterface $factory; public function __construct(FactoryInterface $factory) { diff --git a/src/Sylius/Component/Payment/Model/Payment.php b/src/Sylius/Component/Payment/Model/Payment.php index daf1c655f7a..d7fb91cfd86 100644 --- a/src/Sylius/Component/Payment/Model/Payment.php +++ b/src/Sylius/Component/Payment/Model/Payment.php @@ -22,20 +22,15 @@ class Payment implements PaymentInterface /** @var mixed */ protected $id; - /** @var PaymentMethodInterface */ - protected $method; + protected ?PaymentMethodInterface $method = null; - /** @var string */ - protected $currencyCode; + protected ?string $currencyCode = null; - /** @var int */ - protected $amount = 0; + protected ?int $amount = 0; - /** @var string */ - protected $state = PaymentInterface::STATE_CART; + protected ?string $state = PaymentInterface::STATE_CART; - /** @var array */ - protected $details = []; + protected array $details = []; public function __construct() { diff --git a/src/Sylius/Component/Payment/Model/PaymentMethod.php b/src/Sylius/Component/Payment/Model/PaymentMethod.php index 0884beed08a..b5ffd95b4d0 100644 --- a/src/Sylius/Component/Payment/Model/PaymentMethod.php +++ b/src/Sylius/Component/Payment/Model/PaymentMethod.php @@ -29,14 +29,11 @@ class PaymentMethod implements PaymentMethodInterface /** @var mixed */ protected $id; - /** @var string */ - protected $code; + protected ?string $code = null; - /** @var string */ - protected $environment; + protected ?string $environment = null; - /** @var int */ - protected $position; + protected ?int $position = null; public function __construct() { diff --git a/src/Sylius/Component/Payment/Model/PaymentMethodTranslation.php b/src/Sylius/Component/Payment/Model/PaymentMethodTranslation.php index 5c926433b99..876c44223a0 100644 --- a/src/Sylius/Component/Payment/Model/PaymentMethodTranslation.php +++ b/src/Sylius/Component/Payment/Model/PaymentMethodTranslation.php @@ -20,14 +20,11 @@ class PaymentMethodTranslation extends AbstractTranslation implements PaymentMet /** @var mixed */ protected $id; - /** @var string|null */ - protected $name; + protected ?string $name = null; - /** @var string|null */ - protected $description; + protected ?string $description = null; - /** @var string|null */ - protected $instructions; + protected ?string $instructions = null; public function __toString(): string { diff --git a/src/Sylius/Component/Payment/Resolver/CompositeMethodsResolver.php b/src/Sylius/Component/Payment/Resolver/CompositeMethodsResolver.php index 1246adf0f35..ddeca244cf8 100644 --- a/src/Sylius/Component/Payment/Resolver/CompositeMethodsResolver.php +++ b/src/Sylius/Component/Payment/Resolver/CompositeMethodsResolver.php @@ -18,8 +18,7 @@ final class CompositeMethodsResolver implements PaymentMethodsResolverInterface { - /** @var PrioritizedServiceRegistryInterface */ - private $resolversRegistry; + private PrioritizedServiceRegistryInterface $resolversRegistry; public function __construct(PrioritizedServiceRegistryInterface $resolversRegistry) { diff --git a/src/Sylius/Component/Payment/Resolver/DefaultPaymentMethodResolver.php b/src/Sylius/Component/Payment/Resolver/DefaultPaymentMethodResolver.php index a65dda6ef22..b5471811b77 100644 --- a/src/Sylius/Component/Payment/Resolver/DefaultPaymentMethodResolver.php +++ b/src/Sylius/Component/Payment/Resolver/DefaultPaymentMethodResolver.php @@ -20,8 +20,7 @@ final class DefaultPaymentMethodResolver implements DefaultPaymentMethodResolverInterface { - /** @var PaymentMethodRepositoryInterface */ - private $paymentMethodRepository; + private PaymentMethodRepositoryInterface $paymentMethodRepository; public function __construct(PaymentMethodRepositoryInterface $paymentMethodRepository) { diff --git a/src/Sylius/Component/Payment/Resolver/PaymentMethodsResolver.php b/src/Sylius/Component/Payment/Resolver/PaymentMethodsResolver.php index 14d106dc9e3..d4ff72defc7 100644 --- a/src/Sylius/Component/Payment/Resolver/PaymentMethodsResolver.php +++ b/src/Sylius/Component/Payment/Resolver/PaymentMethodsResolver.php @@ -18,8 +18,7 @@ final class PaymentMethodsResolver implements PaymentMethodsResolverInterface { - /** @var RepositoryInterface */ - private $paymentMethodRepository; + private RepositoryInterface $paymentMethodRepository; public function __construct(RepositoryInterface $paymentMethodRepository) { diff --git a/src/Sylius/Component/Product/Factory/ProductFactory.php b/src/Sylius/Component/Product/Factory/ProductFactory.php index f52160f72c9..f70d079ae35 100644 --- a/src/Sylius/Component/Product/Factory/ProductFactory.php +++ b/src/Sylius/Component/Product/Factory/ProductFactory.php @@ -18,11 +18,9 @@ class ProductFactory implements ProductFactoryInterface { - /** @var FactoryInterface */ - private $factory; + private FactoryInterface $factory; - /** @var FactoryInterface */ - private $variantFactory; + private FactoryInterface $variantFactory; public function __construct( FactoryInterface $factory, diff --git a/src/Sylius/Component/Product/Factory/ProductVariantFactory.php b/src/Sylius/Component/Product/Factory/ProductVariantFactory.php index a51b3d43a18..b873a4c3f62 100644 --- a/src/Sylius/Component/Product/Factory/ProductVariantFactory.php +++ b/src/Sylius/Component/Product/Factory/ProductVariantFactory.php @@ -19,8 +19,7 @@ class ProductVariantFactory implements ProductVariantFactoryInterface { - /** @var FactoryInterface */ - private $factory; + private FactoryInterface $factory; public function __construct(FactoryInterface $factory) { diff --git a/src/Sylius/Component/Product/Generator/ProductVariantGenerator.php b/src/Sylius/Component/Product/Generator/ProductVariantGenerator.php index 25e91e10dc8..205092f40aa 100644 --- a/src/Sylius/Component/Product/Generator/ProductVariantGenerator.php +++ b/src/Sylius/Component/Product/Generator/ProductVariantGenerator.php @@ -22,14 +22,11 @@ final class ProductVariantGenerator implements ProductVariantGeneratorInterface { - /** @var ProductVariantFactoryInterface */ - private $productVariantFactory; + private ProductVariantFactoryInterface $productVariantFactory; - /** @var CartesianSetBuilder */ - private $setBuilder; + private CartesianSetBuilder $setBuilder; - /** @var ProductVariantsParityCheckerInterface */ - private $variantsParityChecker; + private ProductVariantsParityCheckerInterface $variantsParityChecker; public function __construct( ProductVariantFactoryInterface $productVariantFactory, diff --git a/src/Sylius/Component/Product/Model/Product.php b/src/Sylius/Component/Product/Model/Product.php index fe49c42716c..32816dd1751 100644 --- a/src/Sylius/Component/Product/Model/Product.php +++ b/src/Sylius/Component/Product/Model/Product.php @@ -33,36 +33,35 @@ class Product implements ProductInterface /** @var mixed */ protected $id; - /** @var string */ - protected $code; + protected ?string $code = null; /** * @var Collection|AttributeValueInterface[] * * @psalm-var Collection */ - protected $attributes; + protected Collection $attributes; /** * @var Collection|ProductVariantInterface[] * * @psalm-var Collection */ - protected $variants; + protected Collection $variants; /** * @var Collection|ProductOptionInterface[] * * @psalm-var Collection */ - protected $options; + protected Collection $options; /** * @var Collection|ProductAssociationInterface[] * * @psalm-var Collection */ - protected $associations; + protected Collection $associations; public function __construct() { diff --git a/src/Sylius/Component/Product/Model/ProductAssociation.php b/src/Sylius/Component/Product/Model/ProductAssociation.php index 2b1f7f67101..a5c13fb341d 100644 --- a/src/Sylius/Component/Product/Model/ProductAssociation.php +++ b/src/Sylius/Component/Product/Model/ProductAssociation.php @@ -24,18 +24,16 @@ class ProductAssociation implements ProductAssociationInterface /** @var mixed */ protected $id; - /** @var ProductAssociationTypeInterface */ - protected $type; + protected ?ProductAssociationTypeInterface $type = null; - /** @var ProductInterface */ - protected $owner; + protected ?ProductInterface $owner = null; /** * @var Collection|ProductInterface[] * * @psalm-var Collection */ - protected $associatedProducts; + protected Collection $associatedProducts; public function __construct() { diff --git a/src/Sylius/Component/Product/Model/ProductAssociationType.php b/src/Sylius/Component/Product/Model/ProductAssociationType.php index 9462d4c158e..8d65381b587 100644 --- a/src/Sylius/Component/Product/Model/ProductAssociationType.php +++ b/src/Sylius/Component/Product/Model/ProductAssociationType.php @@ -25,14 +25,12 @@ class ProductAssociationType implements ProductAssociationTypeInterface getTranslation as private doGetTranslation; } - /** @var int */ - protected $id; + /** @var mixed */ + protected $id = null; - /** @var string */ - protected $code; + protected ?string $code = null; - /** @var string */ - protected $name; + protected ?string $name = null; public function __construct() { diff --git a/src/Sylius/Component/Product/Model/ProductAssociationTypeTranslation.php b/src/Sylius/Component/Product/Model/ProductAssociationTypeTranslation.php index 5d102e7e4ff..a3c5be0fcc5 100644 --- a/src/Sylius/Component/Product/Model/ProductAssociationTypeTranslation.php +++ b/src/Sylius/Component/Product/Model/ProductAssociationTypeTranslation.php @@ -20,8 +20,7 @@ class ProductAssociationTypeTranslation extends AbstractTranslation implements P /** @var mixed */ protected $id; - /** @var string|null */ - protected $name; + protected ?string $name = null; public function getId() { diff --git a/src/Sylius/Component/Product/Model/ProductOption.php b/src/Sylius/Component/Product/Model/ProductOption.php index d067961b149..8b637e02cac 100644 --- a/src/Sylius/Component/Product/Model/ProductOption.php +++ b/src/Sylius/Component/Product/Model/ProductOption.php @@ -30,18 +30,16 @@ class ProductOption implements ProductOptionInterface /** @var mixed */ protected $id; - /** @var string */ - protected $code; + protected ?string $code = null; - /** @var int */ - protected $position; + protected ?int $position = null; /** * @var Collection|ProductOptionValueInterface[] * * @psalm-var Collection */ - protected $values; + protected Collection $values; public function __construct() { diff --git a/src/Sylius/Component/Product/Model/ProductOptionTranslation.php b/src/Sylius/Component/Product/Model/ProductOptionTranslation.php index d07d2657199..bed2c77ae67 100644 --- a/src/Sylius/Component/Product/Model/ProductOptionTranslation.php +++ b/src/Sylius/Component/Product/Model/ProductOptionTranslation.php @@ -20,8 +20,7 @@ class ProductOptionTranslation extends AbstractTranslation implements ProductOpt /** @var mixed */ protected $id; - /** @var string|null */ - protected $name; + protected ?string $name = null; public function getId() { diff --git a/src/Sylius/Component/Product/Model/ProductOptionValue.php b/src/Sylius/Component/Product/Model/ProductOptionValue.php index e7b2cb14815..ce1bdfe230f 100644 --- a/src/Sylius/Component/Product/Model/ProductOptionValue.php +++ b/src/Sylius/Component/Product/Model/ProductOptionValue.php @@ -26,11 +26,9 @@ class ProductOptionValue implements ProductOptionValueInterface /** @var mixed */ protected $id; - /** @var string|null */ - protected $code; + protected ?string $code = null; - /** @var ProductOptionInterface|null */ - protected $option; + protected ?ProductOptionInterface $option = null; public function __construct() { diff --git a/src/Sylius/Component/Product/Model/ProductOptionValueTranslation.php b/src/Sylius/Component/Product/Model/ProductOptionValueTranslation.php index b5c269355e2..86b881e3053 100644 --- a/src/Sylius/Component/Product/Model/ProductOptionValueTranslation.php +++ b/src/Sylius/Component/Product/Model/ProductOptionValueTranslation.php @@ -20,8 +20,7 @@ class ProductOptionValueTranslation extends AbstractTranslation implements Produ /** @var mixed */ protected $id; - /** @var string|null */ - protected $value; + protected ?string $value = null; public function getId() { diff --git a/src/Sylius/Component/Product/Model/ProductTranslation.php b/src/Sylius/Component/Product/Model/ProductTranslation.php index c63254206f4..91844db58c3 100644 --- a/src/Sylius/Component/Product/Model/ProductTranslation.php +++ b/src/Sylius/Component/Product/Model/ProductTranslation.php @@ -20,20 +20,15 @@ class ProductTranslation extends AbstractTranslation implements ProductTranslati /** @var mixed */ protected $id; - /** @var string|null */ - protected $name; + protected ?string $name = null; - /** @var string|null */ - protected $slug; + protected ?string $slug = null; - /** @var string|null */ - protected $description; + protected ?string $description = null; - /** @var string|null */ - protected $metaKeywords; + protected ?string $metaKeywords = null; - /** @var string|null */ - protected $metaDescription; + protected ?string $metaDescription = null; public function getId() { diff --git a/src/Sylius/Component/Product/Model/ProductVariant.php b/src/Sylius/Component/Product/Model/ProductVariant.php index ca128885dba..55a8f9f1c2a 100644 --- a/src/Sylius/Component/Product/Model/ProductVariant.php +++ b/src/Sylius/Component/Product/Model/ProductVariant.php @@ -31,21 +31,18 @@ class ProductVariant implements ProductVariantInterface /** @var mixed */ protected $id; - /** @var string */ - protected $code; + protected ?string $code = null; - /** @var ProductInterface */ - protected $product; + protected ?ProductInterface $product = null; /** * @var Collection|ProductOptionValueInterface[] * * @psalm-var Collection */ - protected $optionValues; + protected Collection $optionValues; - /** @var int */ - protected $position; + protected ?int $position = null; public function __construct() { diff --git a/src/Sylius/Component/Product/Model/ProductVariantTranslation.php b/src/Sylius/Component/Product/Model/ProductVariantTranslation.php index bd7b41316fd..49f0784ada8 100644 --- a/src/Sylius/Component/Product/Model/ProductVariantTranslation.php +++ b/src/Sylius/Component/Product/Model/ProductVariantTranslation.php @@ -20,8 +20,7 @@ class ProductVariantTranslation extends AbstractTranslation implements ProductVa /** @var mixed */ protected $id; - /** @var string|null */ - protected $name; + protected ?string $name = null; public function getId() { diff --git a/src/Sylius/Component/Promotion/Action/PromotionApplicator.php b/src/Sylius/Component/Promotion/Action/PromotionApplicator.php index df839cb6cbf..e0cd8901ba2 100644 --- a/src/Sylius/Component/Promotion/Action/PromotionApplicator.php +++ b/src/Sylius/Component/Promotion/Action/PromotionApplicator.php @@ -19,8 +19,7 @@ final class PromotionApplicator implements PromotionApplicatorInterface { - /** @var ServiceRegistryInterface */ - private $registry; + private ServiceRegistryInterface $registry; public function __construct(ServiceRegistryInterface $registry) { diff --git a/src/Sylius/Component/Promotion/Checker/Eligibility/CompositePromotionCouponEligibilityChecker.php b/src/Sylius/Component/Promotion/Checker/Eligibility/CompositePromotionCouponEligibilityChecker.php index 628027dde46..4e05147adae 100644 --- a/src/Sylius/Component/Promotion/Checker/Eligibility/CompositePromotionCouponEligibilityChecker.php +++ b/src/Sylius/Component/Promotion/Checker/Eligibility/CompositePromotionCouponEligibilityChecker.php @@ -20,7 +20,7 @@ final class CompositePromotionCouponEligibilityChecker implements PromotionCouponEligibilityCheckerInterface { /** @var PromotionCouponEligibilityCheckerInterface[] */ - private $promotionCouponEligibilityCheckers; + private array $promotionCouponEligibilityCheckers; /** * @param PromotionCouponEligibilityCheckerInterface[] $promotionCouponEligibilityCheckers diff --git a/src/Sylius/Component/Promotion/Checker/Eligibility/CompositePromotionEligibilityChecker.php b/src/Sylius/Component/Promotion/Checker/Eligibility/CompositePromotionEligibilityChecker.php index 7fb7a4b1f7b..737a980fb1d 100644 --- a/src/Sylius/Component/Promotion/Checker/Eligibility/CompositePromotionEligibilityChecker.php +++ b/src/Sylius/Component/Promotion/Checker/Eligibility/CompositePromotionEligibilityChecker.php @@ -20,7 +20,7 @@ final class CompositePromotionEligibilityChecker implements PromotionEligibilityCheckerInterface { /** @var PromotionEligibilityCheckerInterface[] */ - private $promotionEligibilityCheckers; + private array $promotionEligibilityCheckers; /** * @param PromotionEligibilityCheckerInterface[] $promotionEligibilityCheckers diff --git a/src/Sylius/Component/Promotion/Checker/Eligibility/PromotionRulesEligibilityChecker.php b/src/Sylius/Component/Promotion/Checker/Eligibility/PromotionRulesEligibilityChecker.php index 0cf7fe06a6e..adcbe4143c5 100644 --- a/src/Sylius/Component/Promotion/Checker/Eligibility/PromotionRulesEligibilityChecker.php +++ b/src/Sylius/Component/Promotion/Checker/Eligibility/PromotionRulesEligibilityChecker.php @@ -21,8 +21,7 @@ final class PromotionRulesEligibilityChecker implements PromotionEligibilityCheckerInterface { - /** @var ServiceRegistryInterface */ - private $ruleRegistry; + private ServiceRegistryInterface $ruleRegistry; public function __construct(ServiceRegistryInterface $ruleRegistry) { diff --git a/src/Sylius/Component/Promotion/Checker/Eligibility/PromotionSubjectCouponEligibilityChecker.php b/src/Sylius/Component/Promotion/Checker/Eligibility/PromotionSubjectCouponEligibilityChecker.php index 95f0540cd2b..ebf030ca220 100644 --- a/src/Sylius/Component/Promotion/Checker/Eligibility/PromotionSubjectCouponEligibilityChecker.php +++ b/src/Sylius/Component/Promotion/Checker/Eligibility/PromotionSubjectCouponEligibilityChecker.php @@ -19,8 +19,7 @@ final class PromotionSubjectCouponEligibilityChecker implements PromotionEligibilityCheckerInterface { - /** @var PromotionCouponEligibilityCheckerInterface */ - private $promotionCouponEligibilityChecker; + private PromotionCouponEligibilityCheckerInterface $promotionCouponEligibilityChecker; public function __construct(PromotionCouponEligibilityCheckerInterface $promotionCouponEligibilityChecker) { diff --git a/src/Sylius/Component/Promotion/Factory/PromotionCouponFactory.php b/src/Sylius/Component/Promotion/Factory/PromotionCouponFactory.php index b28ee3fe706..969d22a307d 100644 --- a/src/Sylius/Component/Promotion/Factory/PromotionCouponFactory.php +++ b/src/Sylius/Component/Promotion/Factory/PromotionCouponFactory.php @@ -20,8 +20,7 @@ final class PromotionCouponFactory implements PromotionCouponFactoryInterface { - /** @var FactoryInterface */ - private $factory; + private FactoryInterface $factory; public function __construct(FactoryInterface $factory) { diff --git a/src/Sylius/Component/Promotion/Generator/PercentageGenerationPolicy.php b/src/Sylius/Component/Promotion/Generator/PercentageGenerationPolicy.php index ea99a67ba56..c6317aa8731 100644 --- a/src/Sylius/Component/Promotion/Generator/PercentageGenerationPolicy.php +++ b/src/Sylius/Component/Promotion/Generator/PercentageGenerationPolicy.php @@ -18,11 +18,9 @@ final class PercentageGenerationPolicy implements GenerationPolicyInterface { - /** @var PromotionCouponRepositoryInterface */ - private $couponRepository; + private PromotionCouponRepositoryInterface $couponRepository; - /** @var float */ - private $ratio; + private float $ratio; public function __construct(PromotionCouponRepositoryInterface $couponRepository, float $ratio = 0.5) { diff --git a/src/Sylius/Component/Promotion/Generator/PromotionCouponGenerator.php b/src/Sylius/Component/Promotion/Generator/PromotionCouponGenerator.php index 508ba903a94..a8f8bd88f32 100644 --- a/src/Sylius/Component/Promotion/Generator/PromotionCouponGenerator.php +++ b/src/Sylius/Component/Promotion/Generator/PromotionCouponGenerator.php @@ -23,17 +23,13 @@ final class PromotionCouponGenerator implements PromotionCouponGeneratorInterface { - /** @var FactoryInterface */ - private $couponFactory; + private FactoryInterface $couponFactory; - /** @var PromotionCouponRepositoryInterface */ - private $couponRepository; + private PromotionCouponRepositoryInterface $couponRepository; - /** @var ObjectManager */ - private $objectManager; + private ObjectManager $objectManager; - /** @var GenerationPolicyInterface */ - private $generationPolicy; + private GenerationPolicyInterface $generationPolicy; public function __construct( FactoryInterface $couponFactory, diff --git a/src/Sylius/Component/Promotion/Generator/PromotionCouponGeneratorInstruction.php b/src/Sylius/Component/Promotion/Generator/PromotionCouponGeneratorInstruction.php index 932c96dbd1c..d3921b790c9 100644 --- a/src/Sylius/Component/Promotion/Generator/PromotionCouponGeneratorInstruction.php +++ b/src/Sylius/Component/Promotion/Generator/PromotionCouponGeneratorInstruction.php @@ -15,23 +15,17 @@ final class PromotionCouponGeneratorInstruction implements PromotionCouponGeneratorInstructionInterface { - /** @var int */ - private $amount = 5; + private ?int $amount = 5; - /** @var string|null */ - private $prefix; + private ?string $prefix = null; - /** @var int */ - private $codeLength = 6; + private ?int $codeLength = 6; - /** @var string|null */ - private $suffix; + private ?string $suffix = null; - /** @var \DateTimeInterface|null */ - private $expiresAt; + private ?\DateTimeInterface $expiresAt = null; - /** @var int|null */ - private $usageLimit; + private ?int $usageLimit = null; public function getAmount(): ?int { diff --git a/src/Sylius/Component/Promotion/Model/Promotion.php b/src/Sylius/Component/Promotion/Model/Promotion.php index 3f803a23750..9ad84a221d5 100644 --- a/src/Sylius/Component/Promotion/Model/Promotion.php +++ b/src/Sylius/Component/Promotion/Model/Promotion.php @@ -24,64 +24,52 @@ class Promotion implements PromotionInterface /** @var mixed */ protected $id; - /** @var string */ - protected $code; + protected ?string $code = null; - /** @var string */ - protected $name; + protected ?string $name = null; - /** @var string */ - protected $description; + protected ?string $description = null; /** * When exclusive, promotion with top priority will be applied - * - * @var int */ - protected $priority = 0; + protected int $priority = 0; /** * Cannot be applied together with other promotions - * - * @var bool */ - protected $exclusive = false; + protected ?bool $exclusive = false; - /** @var int */ - protected $usageLimit; + protected ?int $usageLimit = null; - /** @var int */ - protected $used = 0; + protected ?int $used = 0; - /** @var \DateTimeInterface */ - protected $startsAt; + protected ?\DateTimeInterface $startsAt = null; - /** @var \DateTimeInterface */ - protected $endsAt; + protected ?\DateTimeInterface $endsAt = null; - /** @var bool */ - protected $couponBased = false; + protected bool $couponBased = false; /** * @var Collection|PromotionCouponInterface[] * * @psalm-var Collection */ - protected $coupons; + protected Collection $coupons; /** * @var Collection|PromotionRuleInterface[] * * @psalm-var Collection */ - protected $rules; + protected Collection $rules; /** * @var Collection|PromotionActionInterface[] * * @psalm-var Collection */ - protected $actions; + protected Collection $actions; public function __construct() { diff --git a/src/Sylius/Component/Promotion/Model/PromotionAction.php b/src/Sylius/Component/Promotion/Model/PromotionAction.php index f37e500693c..f6d12381118 100644 --- a/src/Sylius/Component/Promotion/Model/PromotionAction.php +++ b/src/Sylius/Component/Promotion/Model/PromotionAction.php @@ -18,14 +18,11 @@ class PromotionAction implements PromotionActionInterface /** @var mixed */ protected $id; - /** @var string|null */ - protected $type; + protected ?string $type = null; - /** @var array */ - protected $configuration = []; + protected array $configuration = []; - /** @var PromotionInterface|null */ - protected $promotion; + protected ?PromotionInterface $promotion = null; public function getId() { diff --git a/src/Sylius/Component/Promotion/Model/PromotionCoupon.php b/src/Sylius/Component/Promotion/Model/PromotionCoupon.php index 780dd8b4468..8bd89e913b7 100644 --- a/src/Sylius/Component/Promotion/Model/PromotionCoupon.php +++ b/src/Sylius/Component/Promotion/Model/PromotionCoupon.php @@ -22,20 +22,15 @@ class PromotionCoupon implements PromotionCouponInterface /** @var mixed */ protected $id; - /** @var string|null */ - protected $code; + protected ?string $code = null; - /** @var int|null */ - protected $usageLimit; + protected ?int $usageLimit = null; - /** @var int */ - protected $used = 0; + protected int $used = 0; - /** @var PromotionInterface|null */ - protected $promotion; + protected ?PromotionInterface $promotion = null; - /** @var \DateTimeInterface|null */ - protected $expiresAt; + protected ?\DateTimeInterface $expiresAt = null; public function getId() { diff --git a/src/Sylius/Component/Promotion/Model/PromotionRule.php b/src/Sylius/Component/Promotion/Model/PromotionRule.php index d364ec2a374..6b36faae113 100644 --- a/src/Sylius/Component/Promotion/Model/PromotionRule.php +++ b/src/Sylius/Component/Promotion/Model/PromotionRule.php @@ -18,14 +18,11 @@ class PromotionRule implements PromotionRuleInterface /** @var mixed */ protected $id; - /** @var string|null */ - protected $type; + protected ?string $type = null; - /** @var array */ - protected $configuration = []; + protected array $configuration = []; - /** @var PromotionInterface|null */ - protected $promotion; + protected ?PromotionInterface $promotion = null; public function getId() { diff --git a/src/Sylius/Component/Promotion/Processor/PromotionProcessor.php b/src/Sylius/Component/Promotion/Processor/PromotionProcessor.php index edc4cfa37cc..9e300a628ae 100644 --- a/src/Sylius/Component/Promotion/Processor/PromotionProcessor.php +++ b/src/Sylius/Component/Promotion/Processor/PromotionProcessor.php @@ -20,14 +20,11 @@ final class PromotionProcessor implements PromotionProcessorInterface { - /** @var PreQualifiedPromotionsProviderInterface */ - private $preQualifiedPromotionsProvider; + private PreQualifiedPromotionsProviderInterface $preQualifiedPromotionsProvider; - /** @var PromotionEligibilityCheckerInterface */ - private $promotionEligibilityChecker; + private PromotionEligibilityCheckerInterface $promotionEligibilityChecker; - /** @var PromotionApplicatorInterface */ - private $promotionApplicator; + private PromotionApplicatorInterface $promotionApplicator; public function __construct( PreQualifiedPromotionsProviderInterface $preQualifiedPromotionsProvider, diff --git a/src/Sylius/Component/Promotion/Provider/ActivePromotionsProvider.php b/src/Sylius/Component/Promotion/Provider/ActivePromotionsProvider.php index 9f384986f3b..d6ae1d65f55 100644 --- a/src/Sylius/Component/Promotion/Provider/ActivePromotionsProvider.php +++ b/src/Sylius/Component/Promotion/Provider/ActivePromotionsProvider.php @@ -18,8 +18,7 @@ final class ActivePromotionsProvider implements PreQualifiedPromotionsProviderInterface { - /** @var PromotionRepositoryInterface */ - private $promotionRepository; + private PromotionRepositoryInterface $promotionRepository; public function __construct(PromotionRepositoryInterface $promotionRepository) { diff --git a/src/Sylius/Component/Review/Factory/ReviewFactory.php b/src/Sylius/Component/Review/Factory/ReviewFactory.php index 69a6a05178f..bf2d15d658e 100644 --- a/src/Sylius/Component/Review/Factory/ReviewFactory.php +++ b/src/Sylius/Component/Review/Factory/ReviewFactory.php @@ -20,8 +20,7 @@ final class ReviewFactory implements ReviewFactoryInterface { - /** @var FactoryInterface */ - private $factory; + private FactoryInterface $factory; public function __construct(FactoryInterface $factory) { diff --git a/src/Sylius/Component/Review/Model/Review.php b/src/Sylius/Component/Review/Model/Review.php index aaed2b9f583..5ebdfb2628f 100644 --- a/src/Sylius/Component/Review/Model/Review.php +++ b/src/Sylius/Component/Review/Model/Review.php @@ -19,26 +19,20 @@ class Review implements ReviewInterface { use TimestampableTrait; - /** @var int */ - protected $id; + /** @var mixed */ + protected $id = null; - /** @var string */ - protected $title; + protected ?string $title = null; - /** @var int */ - protected $rating; + protected ?int $rating = null; - /** @var string */ - protected $comment; + protected ?string $comment = null; - /** @var ReviewerInterface */ - protected $author; + protected ?ReviewerInterface $author = null; - /** @var string */ - protected $status = ReviewInterface::STATUS_NEW; + protected ?string $status = ReviewInterface::STATUS_NEW; - /** @var ReviewableInterface */ - protected $reviewSubject; + protected ?ReviewableInterface $reviewSubject = null; public function __construct() { diff --git a/src/Sylius/Component/Review/Model/Reviewer.php b/src/Sylius/Component/Review/Model/Reviewer.php index 26e214b48d0..e1964c8d9e8 100644 --- a/src/Sylius/Component/Review/Model/Reviewer.php +++ b/src/Sylius/Component/Review/Model/Reviewer.php @@ -15,20 +15,17 @@ class Reviewer implements ReviewerInterface { - /** @var int|null */ - protected $id; + /** @var mixed */ + protected $id = null; - /** @var string|null */ - protected $email; + protected ?string $email = null; - /** @var string|null */ - protected $firstName; + protected ?string $firstName = null; - /** @var string|null */ - protected $lastName; + protected ?string $lastName = null; /** - * @return int|null + * @return mixed */ public function getId() { diff --git a/src/Sylius/Component/Shipping/Calculator/DelegatingCalculator.php b/src/Sylius/Component/Shipping/Calculator/DelegatingCalculator.php index 6d0bbb9d0d9..70fdffd3947 100644 --- a/src/Sylius/Component/Shipping/Calculator/DelegatingCalculator.php +++ b/src/Sylius/Component/Shipping/Calculator/DelegatingCalculator.php @@ -18,8 +18,7 @@ final class DelegatingCalculator implements DelegatingCalculatorInterface { - /** @var ServiceRegistryInterface */ - private $registry; + private ServiceRegistryInterface $registry; public function __construct(ServiceRegistryInterface $registry) { diff --git a/src/Sylius/Component/Shipping/Checker/Eligibility/CompositeShippingMethodEligibilityChecker.php b/src/Sylius/Component/Shipping/Checker/Eligibility/CompositeShippingMethodEligibilityChecker.php index 40aa338d9bb..c721e5fba7e 100644 --- a/src/Sylius/Component/Shipping/Checker/Eligibility/CompositeShippingMethodEligibilityChecker.php +++ b/src/Sylius/Component/Shipping/Checker/Eligibility/CompositeShippingMethodEligibilityChecker.php @@ -20,7 +20,7 @@ final class CompositeShippingMethodEligibilityChecker implements ShippingMethodEligibilityCheckerInterface { /** @var ShippingMethodEligibilityCheckerInterface[] */ - private $eligibilityCheckers; + private array $eligibilityCheckers; /** * @param ShippingMethodEligibilityCheckerInterface[] $eligibilityCheckers diff --git a/src/Sylius/Component/Shipping/Checker/Eligibility/ShippingMethodRulesEligibilityChecker.php b/src/Sylius/Component/Shipping/Checker/Eligibility/ShippingMethodRulesEligibilityChecker.php index b35cb1d8bda..020038ae956 100644 --- a/src/Sylius/Component/Shipping/Checker/Eligibility/ShippingMethodRulesEligibilityChecker.php +++ b/src/Sylius/Component/Shipping/Checker/Eligibility/ShippingMethodRulesEligibilityChecker.php @@ -21,8 +21,7 @@ final class ShippingMethodRulesEligibilityChecker implements ShippingMethodEligibilityCheckerInterface { - /** @var ServiceRegistryInterface */ - private $ruleRegistry; + private ServiceRegistryInterface $ruleRegistry; public function __construct(ServiceRegistryInterface $ruleRegistry) { diff --git a/src/Sylius/Component/Shipping/Model/Shipment.php b/src/Sylius/Component/Shipping/Model/Shipment.php index 5d32f74ded5..9c8c1f33524 100644 --- a/src/Sylius/Component/Shipping/Model/Shipment.php +++ b/src/Sylius/Component/Shipping/Model/Shipment.php @@ -24,24 +24,20 @@ class Shipment implements ShipmentInterface /** @var mixed */ protected $id; - /** @var string */ - protected $state = ShipmentInterface::STATE_CART; + protected ?string $state = ShipmentInterface::STATE_CART; - /** @var ShippingMethodInterface|null */ - protected $method; + protected ?ShippingMethodInterface $method = null; /** * @var Collection|ShipmentUnitInterface[] * * @psalm-var Collection */ - protected $units; + protected Collection $units; - /** @var string|null */ - protected $tracking; + protected ?string $tracking = null; - /** @var \DateTimeInterface|null */ - protected $shippedAt; + protected ?\DateTimeInterface $shippedAt = null; public function __construct() { diff --git a/src/Sylius/Component/Shipping/Model/ShipmentUnit.php b/src/Sylius/Component/Shipping/Model/ShipmentUnit.php index c19d8075808..cd327d4a2ee 100644 --- a/src/Sylius/Component/Shipping/Model/ShipmentUnit.php +++ b/src/Sylius/Component/Shipping/Model/ShipmentUnit.php @@ -22,11 +22,9 @@ class ShipmentUnit implements ShipmentUnitInterface /** @var mixed */ protected $id; - /** @var ShipmentInterface */ - protected $shipment; + protected ?ShipmentInterface $shipment = null; - /** @var ShippableInterface */ - protected $shippable; + protected ?ShippableInterface $shippable = null; public function __construct() { diff --git a/src/Sylius/Component/Shipping/Model/ShippingCategory.php b/src/Sylius/Component/Shipping/Model/ShippingCategory.php index ac7736215de..23c119692c5 100644 --- a/src/Sylius/Component/Shipping/Model/ShippingCategory.php +++ b/src/Sylius/Component/Shipping/Model/ShippingCategory.php @@ -22,14 +22,11 @@ class ShippingCategory implements ShippingCategoryInterface /** @var mixed */ protected $id; - /** @var string */ - protected $code; + protected ?string $code = null; - /** @var string */ - protected $name; + protected ?string $name = null; - /** @var string */ - protected $description; + protected ?string $description = null; public function __construct() { diff --git a/src/Sylius/Component/Shipping/Model/ShippingMethod.php b/src/Sylius/Component/Shipping/Model/ShippingMethod.php index df09ee21235..e981b992ad5 100644 --- a/src/Sylius/Component/Shipping/Model/ShippingMethod.php +++ b/src/Sylius/Component/Shipping/Model/ShippingMethod.php @@ -32,30 +32,24 @@ class ShippingMethod implements ShippingMethodInterface /** @var mixed */ protected $id; - /** @var string */ - protected $code; + protected ?string $code = null; - /** @var int */ - protected $position; + protected ?int $position = null; - /** @var ShippingCategoryInterface */ - protected $category; + protected ?ShippingCategoryInterface $category = null; - /** @var int */ - protected $categoryRequirement = ShippingMethodInterface::CATEGORY_REQUIREMENT_MATCH_ANY; + protected ?int $categoryRequirement = ShippingMethodInterface::CATEGORY_REQUIREMENT_MATCH_ANY; - /** @var string */ - protected $calculator; + protected ?string $calculator = null; - /** @var array */ - protected $configuration = []; + protected array $configuration = []; /** * @var Collection|ShippingMethodRuleInterface[] * * @psalm-var Collection */ - protected $rules; + protected Collection $rules; public function __construct() { diff --git a/src/Sylius/Component/Shipping/Model/ShippingMethodRule.php b/src/Sylius/Component/Shipping/Model/ShippingMethodRule.php index e57665c5067..0aa7312cbe6 100644 --- a/src/Sylius/Component/Shipping/Model/ShippingMethodRule.php +++ b/src/Sylius/Component/Shipping/Model/ShippingMethodRule.php @@ -21,14 +21,11 @@ class ShippingMethodRule implements ShippingMethodRuleInterface /** @var mixed */ protected $id; - /** @var string */ - protected $type; + protected ?string $type = null; - /** @var array */ - protected $configuration = []; + protected array $configuration = []; - /** @var ShippingMethodInterface */ - protected $shippingMethod; + protected ?ShippingMethodInterface $shippingMethod = null; public function getId() { diff --git a/src/Sylius/Component/Shipping/Model/ShippingMethodTranslation.php b/src/Sylius/Component/Shipping/Model/ShippingMethodTranslation.php index 83395751870..3da66298fe5 100644 --- a/src/Sylius/Component/Shipping/Model/ShippingMethodTranslation.php +++ b/src/Sylius/Component/Shipping/Model/ShippingMethodTranslation.php @@ -20,11 +20,9 @@ class ShippingMethodTranslation extends AbstractTranslation implements ShippingM /** @var mixed */ protected $id; - /** @var string|null */ - protected $name; + protected ?string $name = null; - /** @var string|null */ - protected $description; + protected ?string $description = null; public function __toString(): string { diff --git a/src/Sylius/Component/Shipping/Resolver/CompositeMethodsResolver.php b/src/Sylius/Component/Shipping/Resolver/CompositeMethodsResolver.php index f120dcf25d4..3ba47e090c3 100644 --- a/src/Sylius/Component/Shipping/Resolver/CompositeMethodsResolver.php +++ b/src/Sylius/Component/Shipping/Resolver/CompositeMethodsResolver.php @@ -18,8 +18,7 @@ final class CompositeMethodsResolver implements ShippingMethodsResolverInterface { - /** @var PrioritizedServiceRegistryInterface */ - private $resolversRegistry; + private PrioritizedServiceRegistryInterface $resolversRegistry; public function __construct(PrioritizedServiceRegistryInterface $resolversRegistry) { diff --git a/src/Sylius/Component/Shipping/Resolver/DefaultShippingMethodResolver.php b/src/Sylius/Component/Shipping/Resolver/DefaultShippingMethodResolver.php index 232f7a06cef..8bdba4141d2 100644 --- a/src/Sylius/Component/Shipping/Resolver/DefaultShippingMethodResolver.php +++ b/src/Sylius/Component/Shipping/Resolver/DefaultShippingMethodResolver.php @@ -20,8 +20,7 @@ final class DefaultShippingMethodResolver implements DefaultShippingMethodResolverInterface { - /** @var ShippingMethodRepositoryInterface */ - private $shippingMethodRepository; + private ShippingMethodRepositoryInterface $shippingMethodRepository; public function __construct(ShippingMethodRepositoryInterface $shippingMethodRepository) { diff --git a/src/Sylius/Component/Shipping/Resolver/ShippingMethodsResolver.php b/src/Sylius/Component/Shipping/Resolver/ShippingMethodsResolver.php index 0ff677daef7..99d4a929590 100644 --- a/src/Sylius/Component/Shipping/Resolver/ShippingMethodsResolver.php +++ b/src/Sylius/Component/Shipping/Resolver/ShippingMethodsResolver.php @@ -19,11 +19,9 @@ final class ShippingMethodsResolver implements ShippingMethodsResolverInterface { - /** @var ObjectRepository */ - private $shippingMethodRepository; + private ObjectRepository $shippingMethodRepository; - /** @var ShippingMethodEligibilityCheckerInterface */ - private $eligibilityChecker; + private ShippingMethodEligibilityCheckerInterface $eligibilityChecker; public function __construct( ObjectRepository $shippingMethodRepository, diff --git a/src/Sylius/Component/Taxation/Calculator/DelegatingCalculator.php b/src/Sylius/Component/Taxation/Calculator/DelegatingCalculator.php index 0fe1d741a1e..fda4e73a432 100644 --- a/src/Sylius/Component/Taxation/Calculator/DelegatingCalculator.php +++ b/src/Sylius/Component/Taxation/Calculator/DelegatingCalculator.php @@ -18,8 +18,7 @@ final class DelegatingCalculator implements CalculatorInterface { - /** @var ServiceRegistryInterface */ - private $calculatorsRegistry; + private ServiceRegistryInterface $calculatorsRegistry; public function __construct(ServiceRegistryInterface $serviceRegistry) { diff --git a/src/Sylius/Component/Taxation/Model/TaxCategory.php b/src/Sylius/Component/Taxation/Model/TaxCategory.php index 0cacc3606ea..fa2252d862f 100644 --- a/src/Sylius/Component/Taxation/Model/TaxCategory.php +++ b/src/Sylius/Component/Taxation/Model/TaxCategory.php @@ -24,21 +24,18 @@ class TaxCategory implements TaxCategoryInterface /** @var mixed */ protected $id; - /** @var string */ - protected $code; + protected ?string $code = null; - /** @var string */ - protected $name; + protected ?string $name = null; - /** @var string */ - protected $description; + protected ?string $description = null; /** * @var Collection|TaxRateInterface[] * * @psalm-var Collection */ - protected $rates; + protected Collection $rates; public function __construct() { diff --git a/src/Sylius/Component/Taxation/Model/TaxRate.php b/src/Sylius/Component/Taxation/Model/TaxRate.php index cf57060d405..ccb13efc236 100644 --- a/src/Sylius/Component/Taxation/Model/TaxRate.php +++ b/src/Sylius/Component/Taxation/Model/TaxRate.php @@ -22,23 +22,17 @@ class TaxRate implements TaxRateInterface /** @var mixed */ protected $id; - /** @var string */ - protected $code; + protected ?string $code = null; - /** @var TaxCategoryInterface */ - protected $category; + protected ?TaxCategoryInterface $category = null; - /** @var string */ - protected $name; + protected ?string $name = null; - /** @var float */ - protected $amount = 0.0; + protected ?float $amount = 0.0; - /** @var bool */ - protected $includedInPrice = false; + protected ?bool $includedInPrice = false; - /** @var string */ - protected $calculator; + protected ?string $calculator = null; public function __construct() { diff --git a/src/Sylius/Component/Taxation/Resolver/TaxRateResolver.php b/src/Sylius/Component/Taxation/Resolver/TaxRateResolver.php index b6bcc1f2e86..9d30e5d213c 100644 --- a/src/Sylius/Component/Taxation/Resolver/TaxRateResolver.php +++ b/src/Sylius/Component/Taxation/Resolver/TaxRateResolver.php @@ -19,8 +19,7 @@ class TaxRateResolver implements TaxRateResolverInterface { - /** @var RepositoryInterface */ - protected $taxRateRepository; + protected RepositoryInterface $taxRateRepository; /** * @var RepositoryInterface diff --git a/src/Sylius/Component/Taxonomy/Factory/TaxonFactory.php b/src/Sylius/Component/Taxonomy/Factory/TaxonFactory.php index 407cc9305c2..aaf53d561b2 100644 --- a/src/Sylius/Component/Taxonomy/Factory/TaxonFactory.php +++ b/src/Sylius/Component/Taxonomy/Factory/TaxonFactory.php @@ -18,8 +18,7 @@ final class TaxonFactory implements TaxonFactoryInterface { - /** @var FactoryInterface */ - private $factory; + private FactoryInterface $factory; public function __construct(FactoryInterface $factory) { diff --git a/src/Sylius/Component/Taxonomy/Model/Taxon.php b/src/Sylius/Component/Taxonomy/Model/Taxon.php index 509ebb4ab15..6abe67b3b84 100644 --- a/src/Sylius/Component/Taxonomy/Model/Taxon.php +++ b/src/Sylius/Component/Taxonomy/Model/Taxon.php @@ -30,33 +30,26 @@ class Taxon implements TaxonInterface /** @var mixed */ protected $id; - /** @var string|null */ - protected $code; + protected ?string $code = null; - /** @var TaxonInterface|null */ - protected $root; + protected ?TaxonInterface $root = null; - /** @var TaxonInterface|null */ - protected $parent; + protected ?TaxonInterface $parent = null; /** * @var Collection|TaxonInterface[] * * @psalm-var Collection */ - protected $children; + protected Collection $children; - /** @var int|null */ - protected $left; + protected ?int $left = null; - /** @var int|null */ - protected $right; + protected ?int $right = null; - /** @var int|null */ - protected $level; + protected ?int $level = null; - /** @var int|null */ - protected $position; + protected ?int $position = null; public function __construct() { diff --git a/src/Sylius/Component/Taxonomy/Model/TaxonTranslation.php b/src/Sylius/Component/Taxonomy/Model/TaxonTranslation.php index 929c1bc09ee..22e35dc5d8f 100644 --- a/src/Sylius/Component/Taxonomy/Model/TaxonTranslation.php +++ b/src/Sylius/Component/Taxonomy/Model/TaxonTranslation.php @@ -20,14 +20,11 @@ class TaxonTranslation extends AbstractTranslation implements TaxonTranslationIn /** @var mixed */ protected $id; - /** @var string|null */ - protected $name; + protected ?string $name = null; - /** @var string|null */ - protected $slug; + protected ?string $slug = null; - /** @var string|null */ - protected $description; + protected ?string $description = null; public function __toString(): string { diff --git a/src/Sylius/Component/User/Model/User.php b/src/Sylius/Component/User/Model/User.php index c54620fe218..46d07cfd302 100644 --- a/src/Sylius/Component/User/Model/User.php +++ b/src/Sylius/Component/User/Model/User.php @@ -25,91 +25,67 @@ class User implements UserInterface /** @var mixed */ protected $id; - /** @var string|null */ - protected $username; + protected ?string $username = null; /** * Normalized representation of a username. - * - * @var string|null */ - protected $usernameCanonical; + protected ?string $usernameCanonical = null; /** * Random data that is used as an additional input to a function that hashes a password. - * - * @var string */ - protected $salt; + protected string $salt; /** * Encrypted password. Must be persisted. - * - * @var string|null */ - protected $password; + protected ?string $password = null; /** * Password before encryption. Used for model validation. Must not be persisted. - * - * @var string|null */ - protected $plainPassword; + protected ?string $plainPassword = null; - /** @var \DateTimeInterface|null */ - protected $lastLogin; + protected ?\DateTimeInterface $lastLogin = null; /** * Random string sent to the user email address in order to verify it - * - * @var string|null */ - protected $emailVerificationToken; + protected ?string $emailVerificationToken = null; /** * Random string sent to the user email address in order to verify the password resetting request - * - * @var string|null */ - protected $passwordResetToken; + protected ?string $passwordResetToken = null; - /** @var \DateTimeInterface|null */ - protected $passwordRequestedAt; + protected ?\DateTimeInterface $passwordRequestedAt = null; - /** @var \DateTimeInterface|null */ - protected $verifiedAt; + protected ?\DateTimeInterface $verifiedAt = null; - /** @var bool */ - protected $locked = false; + protected bool $locked = false; - /** @var \DateTimeInterface|null */ - protected $expiresAt; + protected ?\DateTimeInterface $expiresAt = null; - /** @var \DateTimeInterface|null */ - protected $credentialsExpireAt; + protected ?\DateTimeInterface $credentialsExpireAt = null; /** * We need at least one role to be able to authenticate - * - * @var array */ - protected $roles = [UserInterface::DEFAULT_ROLE]; + protected array $roles = [UserInterface::DEFAULT_ROLE]; /** * @var Collection|UserOAuthInterface[] * * @psalm-var Collection */ - protected $oauthAccounts; + protected Collection $oauthAccounts; - /** @var string|null */ - protected $email; + protected ?string $email = null; - /** @var string|null */ - protected $emailCanonical; + protected ?string $emailCanonical = null; - /** @var string|null */ - protected $encoderName; + protected ?string $encoderName = null; public function __construct() { diff --git a/src/Sylius/Component/User/Model/UserOAuth.php b/src/Sylius/Component/User/Model/UserOAuth.php index cfe89e2063f..3ff9480b115 100644 --- a/src/Sylius/Component/User/Model/UserOAuth.php +++ b/src/Sylius/Component/User/Model/UserOAuth.php @@ -18,20 +18,15 @@ class UserOAuth implements UserOAuthInterface /** @var mixed */ protected $id; - /** @var string|null */ - protected $provider; + protected ?string $provider = null; - /** @var string|null */ - protected $identifier; + protected ?string $identifier = null; - /** @var string|null */ - protected $accessToken; + protected ?string $accessToken = null; - /** @var string|null */ - protected $refreshToken; + protected ?string $refreshToken = null; - /** @var UserInterface|null */ - protected $user; + protected ?UserInterface $user = null; public function getId() { diff --git a/src/Sylius/Component/User/Security/Checker/TokenUniquenessChecker.php b/src/Sylius/Component/User/Security/Checker/TokenUniquenessChecker.php index 91eeedf1a7f..a55d15bd1ac 100644 --- a/src/Sylius/Component/User/Security/Checker/TokenUniquenessChecker.php +++ b/src/Sylius/Component/User/Security/Checker/TokenUniquenessChecker.php @@ -17,11 +17,9 @@ final class TokenUniquenessChecker implements UniquenessCheckerInterface { - /** @var RepositoryInterface */ - private $repository; + private RepositoryInterface $repository; - /** @var string */ - private $tokenFieldName; + private string $tokenFieldName; public function __construct(RepositoryInterface $repository, string $tokenFieldName) { diff --git a/src/Sylius/Component/User/Security/Generator/UniquePinGenerator.php b/src/Sylius/Component/User/Security/Generator/UniquePinGenerator.php index 3f61515e97c..8e9f62b12fa 100644 --- a/src/Sylius/Component/User/Security/Generator/UniquePinGenerator.php +++ b/src/Sylius/Component/User/Security/Generator/UniquePinGenerator.php @@ -19,14 +19,11 @@ final class UniquePinGenerator implements GeneratorInterface { - /** @var RandomnessGeneratorInterface */ - private $generator; + private RandomnessGeneratorInterface $generator; - /** @var UniquenessCheckerInterface */ - private $uniquenessChecker; + private UniquenessCheckerInterface $uniquenessChecker; - /** @var int */ - private $pinLength; + private int $pinLength; /** * @throws \InvalidArgumentException diff --git a/src/Sylius/Component/User/Security/Generator/UniqueTokenGenerator.php b/src/Sylius/Component/User/Security/Generator/UniqueTokenGenerator.php index 243b4489999..e2f5121c077 100644 --- a/src/Sylius/Component/User/Security/Generator/UniqueTokenGenerator.php +++ b/src/Sylius/Component/User/Security/Generator/UniqueTokenGenerator.php @@ -19,14 +19,11 @@ final class UniqueTokenGenerator implements GeneratorInterface { - /** @var RandomnessGeneratorInterface */ - private $generator; + private RandomnessGeneratorInterface $generator; - /** @var UniquenessCheckerInterface */ - private $uniquenessChecker; + private UniquenessCheckerInterface $uniquenessChecker; - /** @var int */ - private $tokenLength; + private int $tokenLength; /** * @throws \InvalidArgumentException diff --git a/src/Sylius/Component/User/Security/PasswordUpdater.php b/src/Sylius/Component/User/Security/PasswordUpdater.php index ad4b4229f60..43a5f26e504 100644 --- a/src/Sylius/Component/User/Security/PasswordUpdater.php +++ b/src/Sylius/Component/User/Security/PasswordUpdater.php @@ -17,8 +17,7 @@ final class PasswordUpdater implements PasswordUpdaterInterface { - /** @var UserPasswordEncoderInterface */ - private $userPasswordEncoder; + private UserPasswordEncoderInterface $userPasswordEncoder; public function __construct(UserPasswordEncoderInterface $passwordEncoder) { diff --git a/src/Sylius/Component/User/Security/UserPbkdf2PasswordEncoder.php b/src/Sylius/Component/User/Security/UserPbkdf2PasswordEncoder.php index 81c3ecc15f4..13447bad673 100644 --- a/src/Sylius/Component/User/Security/UserPbkdf2PasswordEncoder.php +++ b/src/Sylius/Component/User/Security/UserPbkdf2PasswordEncoder.php @@ -29,17 +29,13 @@ final class UserPbkdf2PasswordEncoder implements UserPasswordEncoderInterface { private const MAX_PASSWORD_LENGTH = 4096; - /** @var string */ - private $algorithm; + private string $algorithm; - /** @var bool */ - private $encodeHashAsBase64; + private bool $encodeHashAsBase64; - /** @var int */ - private $iterations; + private int $iterations; - /** @var int */ - private $length; + private int $length; /** * @param int|null $length of the result of encoding