From 7ece6725ef28630995ebb8a467b700748794d768 Mon Sep 17 00:00:00 2001 From: Jacob Tobiasz Date: Thu, 30 Nov 2023 18:37:34 +0100 Subject: [PATCH] Remove Psalm --- .github/workflows/ci_static-checks.yaml | 3 - CONFLICTS.md | 2 - Makefile | 7 +- composer.json | 4 +- psalm.xml | 239 ------------------ .../SyliusAddressingBundle.php | 3 - .../Routing/CachedRouteNameResolver.php | 6 +- .../Command/Account/ChangePaymentMethod.php | 4 +- .../Account/ChangeShopUserPassword.php | 6 +- .../Command/Account/RegisterShopUser.php | 10 +- .../Account/ResendVerificationEmail.php | 4 +- .../Account/SendAccountRegistrationEmail.php | 2 +- .../Account/SendAccountVerificationEmail.php | 2 +- .../Command/Account/VerifyCustomerAccount.php | 2 +- .../ApiBundle/Command/Cart/AddItemToCart.php | 4 +- .../ApiBundle/Command/Cart/BlameCart.php | 4 +- .../Command/Cart/ChangeItemQuantityInCart.php | 2 +- .../ApiBundle/Command/Cart/PickupCart.php | 2 +- .../Command/Cart/RemoveItemFromCart.php | 2 +- .../Command/Catalog/AddProductReview.php | 10 +- .../Command/Checkout/ChoosePaymentMethod.php | 4 +- .../Command/Checkout/ChooseShippingMethod.php | 2 +- .../ApiBundle/Command/Checkout/UpdateCart.php | 6 +- .../Converter/IriToIdentifierConverter.php | 4 - .../CommandArgumentsDenormalizer.php | 4 +- .../Serializer/ShippingMethodNormalizer.php | 2 - .../SelectAttributeChoicesCollectionType.php | 3 - .../AttributeBundle/SyliusAttributeBundle.php | 3 - .../AttributeType/SelectAttributeTypeTest.php | 1 - .../ChannelBundle/SyliusChannelBundle.php | 3 - .../Controller/ProductTaxonController.php | 4 +- .../Controller/ProductVariantController.php | 2 - .../Compiler/IgnoreAnnotationsPass.php | 1 - .../Doctrine/Migrations/AbstractMigration.php | 14 +- .../SqlWalker/OrderByIdentifierSqlWalker.php | 1 - ...ircularDependencyBreakingErrorListener.php | 6 +- .../Form/Extension/LocaleTypeExtension.php | 1 - .../Form/Type/Product/ProductImageType.php | 3 - .../DatabaseSetupCommandsProvider.php | 1 - .../Migrations/Version20220407131547.php | 1 - .../Bundle/CoreBundle/SyliusCoreBundle.php | 3 - .../CoreBundle/Twig/FilterExtension.php | 5 - .../CurrencyBundle/SyliusCurrencyBundle.php | 3 - .../CustomerBundle/SyliusCustomerBundle.php | 3 - .../InventoryBundle/SyliusInventoryBundle.php | 3 - .../LocaleBundle/SyliusLocaleBundle.php | 3 - .../SyliusMoneyTransformer.php | 1 - .../MoneyBundle/Form/Type/MoneyType.php | 3 - .../Controller/OrderController.php | 3 - .../Bundle/OrderBundle/SyliusOrderBundle.php | 3 - .../PaymentBundle/SyliusPaymentBundle.php | 3 - .../Action/Offline/StatusAction.php | 1 - .../Bundle/PayumBundle/Request/GetStatus.php | 2 - .../Controller/ProductSlugController.php | 3 - ...oductsToProductAssociationsTransformer.php | 10 +- .../Type/ProductAutocompleteChoiceType.php | 3 - .../Type/ProductOptionAutocompleteType.php | 3 - .../ProductBundle/SyliusProductBundle.php | 3 - .../AbstractConfigurationCollectionType.php | 3 - .../PromotionBundle/SyliusPromotionBundle.php | 3 - .../src/AppBundle/Entity/PromotionSubject.php | 6 +- .../ReviewBundle/SyliusReviewBundle.php | 3 - .../AbstractConfigurationCollectionType.php | 3 - .../Form/Type/ShippingMethodChoiceType.php | 3 - .../Form/Type/ShippingMethodType.php | 3 - .../ShippingBundle/SyliusShippingBundle.php | 3 - .../TaxationBundle/SyliusTaxationBundle.php | 3 - .../Form/Type/TaxonAutocompleteChoiceType.php | 3 - .../Repository/TaxonTreeRepository.php | 4 + .../TaxonomyBundle/SyliusTaxonomyBundle.php | 3 - .../TemplateBlockRenderingHistory.php | 6 +- .../DependencyInjection/SyliusUiExtension.php | 4 +- .../Registry/TemplateBlockRegistry.php | 14 +- .../TemplateBlockRegistryInterface.php | 10 +- .../TemplateEventRendererInterface.php | 4 +- .../Controller/SecurityController.php | 2 - .../Bundle/UserBundle/Security/UserLogin.php | 1 - .../Security/UserPasswordEncoder.php | 4 - .../Security/UserPasswordHasher.php | 1 - .../Bundle/UserBundle/SyliusUserBundle.php | 3 - .../Component/Addressing/Model/Country.php | 6 +- .../Addressing/Model/CountryInterface.php | 4 +- .../Component/Addressing/Model/Zone.php | 6 +- .../Addressing/Model/ZoneInterface.php | 4 +- .../Model/AttributeSubjectInterface.php | 8 +- .../Context/CompositeChannelContext.php | 6 +- .../RequestBased/CompositeRequestResolver.php | 6 +- .../Channel/Model/ChannelsAwareInterface.php | 4 +- .../Component/Core/Dashboard/SalesSummary.php | 2 +- .../Component/Core/Model/CatalogPromotion.php | 10 +- .../Core/Model/CatalogPromotionInterface.php | 4 + src/Sylius/Component/Core/Model/Channel.php | 18 +- .../Component/Core/Model/ChannelInterface.php | 4 +- .../Component/Core/Model/ChannelPricing.php | 6 +- src/Sylius/Component/Core/Model/Customer.php | 13 +- .../Core/Model/CustomerInterface.php | 8 +- .../Core/Model/ImagesAwareInterface.php | 8 +- src/Sylius/Component/Core/Model/Order.php | 22 +- .../Component/Core/Model/OrderInterface.php | 20 +- .../Component/Core/Model/PaymentMethod.php | 6 +- src/Sylius/Component/Core/Model/Product.php | 30 +-- .../Component/Core/Model/ProductImage.php | 6 +- .../Core/Model/ProductImageInterface.php | 4 +- .../Model/ProductImagesAwareInterface.php | 8 +- .../Component/Core/Model/ProductInterface.php | 4 +- .../Model/ProductTaxonsAwareInterface.php | 8 +- .../Component/Core/Model/ProductVariant.php | 14 +- .../Core/Model/ProductVariantInterface.php | 4 +- src/Sylius/Component/Core/Model/Promotion.php | 10 +- src/Sylius/Component/Core/Model/Shipment.php | 6 +- .../Component/Core/Model/ShippingMethod.php | 10 +- src/Sylius/Component/Core/Model/Taxon.php | 6 +- .../OrderPaymentStateResolver.php | 4 +- .../OrderItemUnitsTaxesApplicator.php | 1 + .../Component/Core/Uploader/ImageUploader.php | 1 - .../Context/CompositeCurrencyContext.php | 6 +- .../Model/CurrenciesAwareInterface.php | 4 +- .../Component/Currency/Model/ExchangeRate.php | 4 - .../Locale/Context/CompositeLocaleContext.php | 6 +- .../Locale/Model/LocalesAwareInterface.php | 4 +- .../Order/Context/CompositeCartContext.php | 6 +- .../Order/Factory/OrderItemUnitFactory.php | 2 +- .../Order/Model/AdjustableInterface.php | 4 +- src/Sylius/Component/Order/Model/Order.php | 12 +- .../Component/Order/Model/OrderInterface.php | 8 +- .../Component/Order/Model/OrderItem.php | 12 +- .../Order/Model/OrderItemInterface.php | 8 +- .../Component/Order/Model/OrderItemUnit.php | 6 +- .../Processor/CompositeOrderProcessor.php | 6 +- .../Model/PaymentsSubjectInterface.php | 4 +- .../Factory/ProductFactoryInterface.php | 3 + .../Component/Product/Model/Product.php | 24 +- .../Product/Model/ProductAssociation.php | 6 +- .../Model/ProductAssociationInterface.php | 4 +- .../Product/Model/ProductInterface.php | 16 +- .../Component/Product/Model/ProductOption.php | 6 +- .../Product/Model/ProductOptionInterface.php | 4 +- .../Product/Model/ProductVariant.php | 6 +- .../Product/Model/ProductVariantInterface.php | 4 +- ...leProductOptionValuesResolverInterface.php | 4 +- .../Promotion/Model/CatalogPromotion.php | 7 +- .../Model/CatalogPromotionInterface.php | 8 +- .../Component/Promotion/Model/Promotion.php | 18 +- .../Promotion/Model/PromotionInterface.php | 12 +- .../Model/PromotionSubjectInterface.php | 4 +- .../Review/Model/ReviewableInterface.php | 4 +- .../ShippingMethodEligibilityChecker.php | 5 +- .../Component/Shipping/Model/Shipment.php | 6 +- .../Shipping/Model/ShipmentInterface.php | 4 +- .../Shipping/Model/ShippingMethod.php | 6 +- .../Model/ShippingMethodInterface.php | 4 +- .../Shipping/Model/ShippingMethodRule.php | 3 - .../Model/ShippingSubjectInterface.php | 4 +- .../Component/Taxation/Model/TaxCategory.php | 6 +- .../Taxation/Model/TaxCategoryInterface.php | 4 +- .../Component/Taxation/Model/TaxRate.php | 1 - src/Sylius/Component/Taxonomy/Model/Taxon.php | 6 +- .../Taxonomy/Model/TaxonInterface.php | 12 +- .../Taxonomy/Model/TaxonsAwareInterface.php | 4 +- src/Sylius/Component/User/Model/User.php | 7 +- .../Component/User/Model/UserInterface.php | 4 +- .../User/Security/PasswordUpdater.php | 1 - 162 files changed, 179 insertions(+), 932 deletions(-) delete mode 100644 psalm.xml diff --git a/.github/workflows/ci_static-checks.yaml b/.github/workflows/ci_static-checks.yaml index 2c875f55ad4..e706b5e8ada 100644 --- a/.github/workflows/ci_static-checks.yaml +++ b/.github/workflows/ci_static-checks.yaml @@ -95,9 +95,6 @@ jobs: - name: Run PHPArkitect run: vendor/bin/phparkitect check - - name: Run Psalm - run: vendor/bin/psalm --show-info=false --output-format=github --php-version=${{ matrix.php }} - - name: Run PHPStan run: vendor/bin/phpstan analyse diff --git a/CONFLICTS.md b/CONFLICTS.md index ae548e91004..e5ecc2bac32 100644 --- a/CONFLICTS.md +++ b/CONFLICTS.md @@ -20,8 +20,6 @@ references related issues. This version is causing a problem with mink session: `InvalidArgumentException: Specify session name to get in vendor/friends-of-behat/mink/src/Mink.php:198`, - Psalm error: - `UndefinedDocblockClass: Docblock-defined class, interface or enum named UnitEnum does not exist`. - `symfony/framework-bundle:5.4.5`: diff --git a/Makefile b/Makefile index 19078889d96..d34055e0ff1 100644 --- a/Makefile +++ b/Makefile @@ -7,9 +7,6 @@ phpspec: phpstan: vendor/bin/phpstan analyse -psalm: - vendor/bin/psalm - behat-cli: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@javascript&&@cli&&~@todo" || vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@javascript&&@cli&&~@todo" --rerun @@ -35,11 +32,11 @@ behat: behat-cli behat-non-js behat-js init: install backend frontend -ci: init phpstan psalm phpunit phpspec behat +ci: init phpstan phpunit phpspec behat integration: init phpunit behat-cli behat-non-js -static: install phpspec phpstan psalm +static: install phpspec phpstan # Example execution: make profile url=http://app profile: diff --git a/composer.json b/composer.json index bf1a1852cb6..ad00ea0f28b 100644 --- a/composer.json +++ b/composer.json @@ -221,7 +221,6 @@ "phpstan/phpstan-webmozart-assert": "^1.1", "phpunit/phpunit": "^8.5", "polishsymfonycommunity/symfony-mocker-container": "^1.0", - "psalm/plugin-mockery": "0.7.0", "psr/event-dispatcher": "^1.0", "rector/rector": "^0.12.20", "stripe/stripe-php": "^8.1", @@ -232,8 +231,7 @@ "symfony/flex": "^1.7", "symfony/runtime": "^5.4 || ^6.0", "symfony/web-profiler-bundle": "^5.4 || ^6.0", - "symplify/monorepo-builder": "^11.0", - "vimeo/psalm": "^4.19" + "symplify/monorepo-builder": "^11.0" }, "suggest": { "ext-iconv": "For better performance than using Symfony Polyfill Component", diff --git a/psalm.xml b/psalm.xml deleted file mode 100644 index 8324961da4d..00000000000 --- a/psalm.xml +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Sylius/Bundle/AddressingBundle/SyliusAddressingBundle.php b/src/Sylius/Bundle/AddressingBundle/SyliusAddressingBundle.php index aad93cfb64f..60e142b26db 100644 --- a/src/Sylius/Bundle/AddressingBundle/SyliusAddressingBundle.php +++ b/src/Sylius/Bundle/AddressingBundle/SyliusAddressingBundle.php @@ -25,9 +25,6 @@ public function getSupportedDrivers(): array ]; } - /** - * @psalm-suppress MismatchingDocblockReturnType https://github.com/vimeo/psalm/issues/2345 - */ protected function getModelNamespace(): string { return 'Sylius\Component\Addressing\Model'; diff --git a/src/Sylius/Bundle/ApiBundle/ApiPlatform/Bridge/Symfony/Routing/CachedRouteNameResolver.php b/src/Sylius/Bundle/ApiBundle/ApiPlatform/Bridge/Symfony/Routing/CachedRouteNameResolver.php index 838241b6215..171f5f5ebe0 100644 --- a/src/Sylius/Bundle/ApiBundle/ApiPlatform/Bridge/Symfony/Routing/CachedRouteNameResolver.php +++ b/src/Sylius/Bundle/ApiBundle/ApiPlatform/Bridge/Symfony/Routing/CachedRouteNameResolver.php @@ -49,11 +49,7 @@ public function getRouteName(string $resourceClass, $operationType /*, array $co ); return $this->getCached($cacheKey, function () use ($resourceClass, $operationType, $context) { - /** - * @psalm-suppress TooManyArguments - * - * @phpstan-ignore-next-line - */ + /** @phpstan-ignore-next-line */ return $this->decorated->getRouteName($resourceClass, $operationType, $context); }); } diff --git a/src/Sylius/Bundle/ApiBundle/Command/Account/ChangePaymentMethod.php b/src/Sylius/Bundle/ApiBundle/Command/Account/ChangePaymentMethod.php index 610120cc2ef..7ca77c32040 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Account/ChangePaymentMethod.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Account/ChangePaymentMethod.php @@ -24,14 +24,14 @@ class ChangePaymentMethod implements OrderTokenValueAwareInterface, SubresourceI public $orderTokenValue; /** - * @psalm-immutable + * @immutable * * @var string|null */ public $paymentId; /** - * @psalm-immutable + * @immutable * * @var string */ diff --git a/src/Sylius/Bundle/ApiBundle/Command/Account/ChangeShopUserPassword.php b/src/Sylius/Bundle/ApiBundle/Command/Account/ChangeShopUserPassword.php index 4758fbda690..73775167a78 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Account/ChangeShopUserPassword.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Account/ChangeShopUserPassword.php @@ -22,21 +22,21 @@ class ChangeShopUserPassword implements ShopUserIdAwareInterface public $shopUserId; /** - * @psalm-immutable + * @immutable * * @var string|null */ public $newPassword; /** - * @psalm-immutable + * @immutable * * @var string|null */ public $confirmNewPassword; /** - * @psalm-immutable + * @immutable * * @var string|null */ diff --git a/src/Sylius/Bundle/ApiBundle/Command/Account/RegisterShopUser.php b/src/Sylius/Bundle/ApiBundle/Command/Account/RegisterShopUser.php index cca39f10592..27a11cf356a 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Account/RegisterShopUser.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Account/RegisterShopUser.php @@ -22,35 +22,35 @@ class RegisterShopUser implements ChannelCodeAwareInterface, LocaleCodeAwareInterface { /** - * @psalm-immutable + * @immutable * * @var string */ public $firstName; /** - * @psalm-immutable + * @immutable * * @var string */ public $lastName; /** - * @psalm-immutable + * @immutable * * @var string */ public $email; /** - * @psalm-immutable + * @immutable * * @var string */ public $password; /** - * @psalm-immutable + * @immutable * * @var bool */ diff --git a/src/Sylius/Bundle/ApiBundle/Command/Account/ResendVerificationEmail.php b/src/Sylius/Bundle/ApiBundle/Command/Account/ResendVerificationEmail.php index 601d45f193d..41c57006f4e 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Account/ResendVerificationEmail.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Account/ResendVerificationEmail.php @@ -25,14 +25,14 @@ class ResendVerificationEmail implements ShopUserIdAwareInterface, ChannelCodeAw public $shopUserId; /** - * @psalm-immutable + * @immutable * * @var string|null */ public $channelCode; /** - * @psalm-immutable + * @immutable * * @var string|null */ diff --git a/src/Sylius/Bundle/ApiBundle/Command/Account/SendAccountRegistrationEmail.php b/src/Sylius/Bundle/ApiBundle/Command/Account/SendAccountRegistrationEmail.php index ff872d4f307..b92fed382b4 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Account/SendAccountRegistrationEmail.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Account/SendAccountRegistrationEmail.php @@ -16,7 +16,7 @@ /** * @experimental * - * @psalm-immutable + * @immutable */ class SendAccountRegistrationEmail { diff --git a/src/Sylius/Bundle/ApiBundle/Command/Account/SendAccountVerificationEmail.php b/src/Sylius/Bundle/ApiBundle/Command/Account/SendAccountVerificationEmail.php index cd05679c938..a602cfb72f2 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Account/SendAccountVerificationEmail.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Account/SendAccountVerificationEmail.php @@ -16,7 +16,7 @@ /** * @experimental * - * @psalm-immutable + * @immutable */ class SendAccountVerificationEmail { diff --git a/src/Sylius/Bundle/ApiBundle/Command/Account/VerifyCustomerAccount.php b/src/Sylius/Bundle/ApiBundle/Command/Account/VerifyCustomerAccount.php index f9013a15a1a..c24a362563d 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Account/VerifyCustomerAccount.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Account/VerifyCustomerAccount.php @@ -16,7 +16,7 @@ /** * @experimental * - * @psalm-immutable + * @immutable */ class VerifyCustomerAccount { diff --git a/src/Sylius/Bundle/ApiBundle/Command/Cart/AddItemToCart.php b/src/Sylius/Bundle/ApiBundle/Command/Cart/AddItemToCart.php index 71670241f91..1cc69210b3b 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Cart/AddItemToCart.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Cart/AddItemToCart.php @@ -23,14 +23,14 @@ class AddItemToCart implements OrderTokenValueAwareInterface, IriToIdentifierCon public $orderTokenValue; /** - * @psalm-immutable + * @immutable * * @var string */ public $productVariantCode; /** - * @psalm-immutable + * @immutable * * @var int */ diff --git a/src/Sylius/Bundle/ApiBundle/Command/Cart/BlameCart.php b/src/Sylius/Bundle/ApiBundle/Command/Cart/BlameCart.php index bd4cea3b59b..369343cd98c 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Cart/BlameCart.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Cart/BlameCart.php @@ -17,14 +17,14 @@ class BlameCart { /** - * @psalm-immutable + * @immutable * * @var string */ public $shopUserEmail; /** - * @psalm-immutable + * @immutable * * @var string */ diff --git a/src/Sylius/Bundle/ApiBundle/Command/Cart/ChangeItemQuantityInCart.php b/src/Sylius/Bundle/ApiBundle/Command/Cart/ChangeItemQuantityInCart.php index 3ee1a338e50..36acbbf384d 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Cart/ChangeItemQuantityInCart.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Cart/ChangeItemQuantityInCart.php @@ -26,7 +26,7 @@ class ChangeItemQuantityInCart implements OrderTokenValueAwareInterface, Subreso public $orderItemId; /** - * @psalm-immutable + * @immutable * * @var int */ diff --git a/src/Sylius/Bundle/ApiBundle/Command/Cart/PickupCart.php b/src/Sylius/Bundle/ApiBundle/Command/Cart/PickupCart.php index 1a08b89695a..e5f6aa6a015 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Cart/PickupCart.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Cart/PickupCart.php @@ -21,7 +21,7 @@ class PickupCart implements ChannelCodeAwareInterface, CustomerEmailAwareInterface, LocaleCodeAwareInterface { /** - * @psalm-immutable + * @immutable * * @var string|null */ diff --git a/src/Sylius/Bundle/ApiBundle/Command/Cart/RemoveItemFromCart.php b/src/Sylius/Bundle/ApiBundle/Command/Cart/RemoveItemFromCart.php index c359baf5ab7..19d82a7568a 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Cart/RemoveItemFromCart.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Cart/RemoveItemFromCart.php @@ -22,7 +22,7 @@ class RemoveItemFromCart implements OrderTokenValueAwareInterface public $orderTokenValue; /** - * @psalm-immutable + * @immutable * * @var string */ diff --git a/src/Sylius/Bundle/ApiBundle/Command/Catalog/AddProductReview.php b/src/Sylius/Bundle/ApiBundle/Command/Catalog/AddProductReview.php index 52af00ce339..0cf2435ce2e 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Catalog/AddProductReview.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Catalog/AddProductReview.php @@ -20,35 +20,35 @@ class AddProductReview implements IriToIdentifierConversionAwareInterface, CustomerEmailAwareInterface { /** - * @psalm-immutable + * @immutable * * @var string|null */ public $title; /** - * @psalm-immutable + * @immutable * * @var int|null */ public $rating; /** - * @psalm-immutable + * @immutable * * @var string|null */ public $comment; /** - * @psalm-immutable + * @immutable * * @var string */ public $productCode; /** - * @psalm-immutable + * @immutable * * @var string|null */ diff --git a/src/Sylius/Bundle/ApiBundle/Command/Checkout/ChoosePaymentMethod.php b/src/Sylius/Bundle/ApiBundle/Command/Checkout/ChoosePaymentMethod.php index d453dede1b2..bf6b52af177 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Checkout/ChoosePaymentMethod.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Checkout/ChoosePaymentMethod.php @@ -25,14 +25,14 @@ class ChoosePaymentMethod implements OrderTokenValueAwareInterface, SubresourceI public $orderTokenValue; /** - * @psalm-immutable + * @immutable * * @var string|null */ public $paymentId; /** - * @psalm-immutable + * @immutable * * @var string|null */ diff --git a/src/Sylius/Bundle/ApiBundle/Command/Checkout/ChooseShippingMethod.php b/src/Sylius/Bundle/ApiBundle/Command/Checkout/ChooseShippingMethod.php index 976801493e0..85655ab00de 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Checkout/ChooseShippingMethod.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Checkout/ChooseShippingMethod.php @@ -27,7 +27,7 @@ class ChooseShippingMethod implements OrderTokenValueAwareInterface, Subresource public $shipmentId; /** - * @psalm-immutable + * @immutable * * @var string */ diff --git a/src/Sylius/Bundle/ApiBundle/Command/Checkout/UpdateCart.php b/src/Sylius/Bundle/ApiBundle/Command/Checkout/UpdateCart.php index ccd599fba8e..bd5a29a71d1 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Checkout/UpdateCart.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Checkout/UpdateCart.php @@ -23,13 +23,13 @@ class UpdateCart implements OrderTokenValueAwareInterface, CustomerEmailAwareInt { public ?string $orderTokenValue = null; - /** @psalm-immutable */ + /** @immutable */ public ?string $email = null; - /** @psalm-immutable */ + /** @immutable */ public ?AddressInterface $billingAddress = null; - /** @psalm-immutable */ + /** @immutable */ public ?AddressInterface $shippingAddress = null; public ?string $couponCode = null; diff --git a/src/Sylius/Bundle/ApiBundle/Converter/IriToIdentifierConverter.php b/src/Sylius/Bundle/ApiBundle/Converter/IriToIdentifierConverter.php index 327ad2c0395..17cd40ddf38 100644 --- a/src/Sylius/Bundle/ApiBundle/Converter/IriToIdentifierConverter.php +++ b/src/Sylius/Bundle/ApiBundle/Converter/IriToIdentifierConverter.php @@ -54,10 +54,6 @@ public function getIdentifier(?string $iri): ?string throw new InvalidArgumentException(sprintf('No resource associated to "%s".', $iri)); } - /** - * @psalm-suppress InternalClass - * @psalm-suppress InternalMethod - */ $attributes = AttributesExtractor::extractAttributes($parameters); try { diff --git a/src/Sylius/Bundle/ApiBundle/Serializer/CommandArgumentsDenormalizer.php b/src/Sylius/Bundle/ApiBundle/Serializer/CommandArgumentsDenormalizer.php index 20fe4192933..4c30b719d17 100644 --- a/src/Sylius/Bundle/ApiBundle/Serializer/CommandArgumentsDenormalizer.php +++ b/src/Sylius/Bundle/ApiBundle/Serializer/CommandArgumentsDenormalizer.php @@ -31,7 +31,7 @@ public function __construct( public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { - /** @psalm-var class-string|null $inputClassName */ + /** @var class-string|null $inputClassName */ $inputClassName = $this->getInputClassName($context); if ($inputClassName === null) { @@ -49,7 +49,7 @@ public function supportsDenormalization($data, $type, $format = null, array $con public function denormalize($data, $type, $format = null, array $context = []) { - /** @psalm-var class-string $inputClassName */ + /** @var class-string $inputClassName */ $inputClassName = $this->getInputClassName($context); foreach (class_implements($inputClassName) as $classInterface) { diff --git a/src/Sylius/Bundle/ApiBundle/Serializer/ShippingMethodNormalizer.php b/src/Sylius/Bundle/ApiBundle/Serializer/ShippingMethodNormalizer.php index e40511ae53c..e5f617538bb 100644 --- a/src/Sylius/Bundle/ApiBundle/Serializer/ShippingMethodNormalizer.php +++ b/src/Sylius/Bundle/ApiBundle/Serializer/ShippingMethodNormalizer.php @@ -55,9 +55,7 @@ public function normalize($object, $format = null, array $context = []) $filters = $request->attributes->get('_api_filters'); if (null === $filters) { - /** @psalm-suppress InternalMethod **/ $queryString = RequestParser::getQueryString($request); - /** @psalm-suppress InternalMethod **/ $filters = $queryString ? RequestParser::parseRequestParams($queryString) : null; } diff --git a/src/Sylius/Bundle/AttributeBundle/Form/Type/AttributeType/Configuration/SelectAttributeChoicesCollectionType.php b/src/Sylius/Bundle/AttributeBundle/Form/Type/AttributeType/Configuration/SelectAttributeChoicesCollectionType.php index e5761a58cbe..aeea8672e75 100644 --- a/src/Sylius/Bundle/AttributeBundle/Form/Type/AttributeType/Configuration/SelectAttributeChoicesCollectionType.php +++ b/src/Sylius/Bundle/AttributeBundle/Form/Type/AttributeType/Configuration/SelectAttributeChoicesCollectionType.php @@ -32,9 +32,6 @@ public function __construct(?TranslationLocaleProviderInterface $localeProvider } } - /** - * @psalm-suppress InvalidScalarArgument Some weird magic going on here, not sure about refactor - */ public function buildForm(FormBuilderInterface $builder, array $options): void { $builder->addEventListener(FormEvents::SUBMIT, function (FormEvent $event) { diff --git a/src/Sylius/Bundle/AttributeBundle/SyliusAttributeBundle.php b/src/Sylius/Bundle/AttributeBundle/SyliusAttributeBundle.php index 4c206c01f56..b16798b08af 100644 --- a/src/Sylius/Bundle/AttributeBundle/SyliusAttributeBundle.php +++ b/src/Sylius/Bundle/AttributeBundle/SyliusAttributeBundle.php @@ -36,9 +36,6 @@ public function build(ContainerBuilder $container): void $container->addCompilerPass(new RegisterAttributeFactoryPass()); } - /** - * @psalm-suppress MismatchingDocblockReturnType https://github.com/vimeo/psalm/issues/2345 - */ protected function getModelNamespace(): string { return 'Sylius\Component\Attribute\Model'; diff --git a/src/Sylius/Bundle/AttributeBundle/Tests/Form/Type/AttributeType/SelectAttributeTypeTest.php b/src/Sylius/Bundle/AttributeBundle/Tests/Form/Type/AttributeType/SelectAttributeTypeTest.php index 8773b299b8d..4857325229a 100644 --- a/src/Sylius/Bundle/AttributeBundle/Tests/Form/Type/AttributeType/SelectAttributeTypeTest.php +++ b/src/Sylius/Bundle/AttributeBundle/Tests/Form/Type/AttributeType/SelectAttributeTypeTest.php @@ -43,7 +43,6 @@ public function it_return_all_choices(): void protected function setUp(): void { $this->translationProvider = $this->prophesize(TranslationLocaleProviderInterface::class); - /** @psalm-suppress TooManyArguments */ $this->translationProvider->getDefaultLocaleCode()->willReturn('en_GB'); parent::setUp(); diff --git a/src/Sylius/Bundle/ChannelBundle/SyliusChannelBundle.php b/src/Sylius/Bundle/ChannelBundle/SyliusChannelBundle.php index 71909f31341..da45d408903 100644 --- a/src/Sylius/Bundle/ChannelBundle/SyliusChannelBundle.php +++ b/src/Sylius/Bundle/ChannelBundle/SyliusChannelBundle.php @@ -36,9 +36,6 @@ public function build(ContainerBuilder $container): void $container->addCompilerPass(new CompositeRequestResolverPass()); } - /** - * @psalm-suppress MismatchingDocblockReturnType https://github.com/vimeo/psalm/issues/2345 - */ protected function getModelNamespace(): string { return 'Sylius\Component\Channel\Model'; diff --git a/src/Sylius/Bundle/CoreBundle/Controller/ProductTaxonController.php b/src/Sylius/Bundle/CoreBundle/Controller/ProductTaxonController.php index b450ef28c1c..3d35f5cd00d 100644 --- a/src/Sylius/Bundle/CoreBundle/Controller/ProductTaxonController.php +++ b/src/Sylius/Bundle/CoreBundle/Controller/ProductTaxonController.php @@ -32,8 +32,6 @@ class ProductTaxonController extends ResourceController * @throws HttpException * * @deprecated This ajax action is deprecated and will be removed in Sylius 2.0 - use ProductTaxonController::updateProductTaxonsPositionsAction instead. - * - * @psalm-suppress DeprecatedMethod */ public function updatePositionsAction(Request $request): Response { @@ -43,7 +41,7 @@ public function updatePositionsAction(Request $request): Response $this->validateCsrfProtection($request, $configuration); if ($this->shouldProductsPositionsBeUpdated($request, $productTaxons)) { - /** @psalm-var array{position: string|int, id: int} $productTaxon */ + /** @var array{position: string|int, id: int} $productTaxon */ foreach ($productTaxons as $productTaxon) { try { $id = $productTaxon['id']; diff --git a/src/Sylius/Bundle/CoreBundle/Controller/ProductVariantController.php b/src/Sylius/Bundle/CoreBundle/Controller/ProductVariantController.php index 4b99861c2b1..e00cca73dca 100644 --- a/src/Sylius/Bundle/CoreBundle/Controller/ProductVariantController.php +++ b/src/Sylius/Bundle/CoreBundle/Controller/ProductVariantController.php @@ -25,8 +25,6 @@ class ProductVariantController extends ResourceController { /** * @throws HttpException - * - * @psalm-suppress DeprecatedMethod */ public function updatePositionsAction(Request $request): Response { diff --git a/src/Sylius/Bundle/CoreBundle/DependencyInjection/Compiler/IgnoreAnnotationsPass.php b/src/Sylius/Bundle/CoreBundle/DependencyInjection/Compiler/IgnoreAnnotationsPass.php index 35b2875a932..1d8bf23233d 100644 --- a/src/Sylius/Bundle/CoreBundle/DependencyInjection/Compiler/IgnoreAnnotationsPass.php +++ b/src/Sylius/Bundle/CoreBundle/DependencyInjection/Compiler/IgnoreAnnotationsPass.php @@ -26,6 +26,5 @@ public function process(ContainerBuilder $container): void $annotationsReader = $container->getDefinition('annotations.reader'); $annotationsReader->addMethodCall('addGlobalIgnoredName', ['template']); - $annotationsReader->addMethodCall('addGlobalIgnoredName', ['psalm']); } } diff --git a/src/Sylius/Bundle/CoreBundle/Doctrine/Migrations/AbstractMigration.php b/src/Sylius/Bundle/CoreBundle/Doctrine/Migrations/AbstractMigration.php index 5e2622ae8e5..044635df8cc 100644 --- a/src/Sylius/Bundle/CoreBundle/Doctrine/Migrations/AbstractMigration.php +++ b/src/Sylius/Bundle/CoreBundle/Doctrine/Migrations/AbstractMigration.php @@ -32,12 +32,10 @@ protected function isMariaDb(): bool { $platform = $this->connection->getDatabasePlatform(); - /** @psalm-suppress DeprecatedClass */ if (class_exists(\Doctrine\DBAL\Platforms\MariaDb1027Platform::class) && is_a($platform, \Doctrine\DBAL\Platforms\MariaDb1027Platform::class)) { return true; } - /** @psalm-suppress DeprecatedClass */ if (class_exists(\Doctrine\DBAL\Platforms\MariaDBPlatform::class) && is_a($platform, \Doctrine\DBAL\Platforms\MariaDBPlatform::class)) { return true; } @@ -49,20 +47,12 @@ protected function isMySql(): bool { $platform = $this->connection->getDatabasePlatform(); - /** - * @phpstan-ignore-next-line - * - * @psalm-suppress InvalidClass - */ + /** @phpstan-ignore-next-line */ if ($this->classExistsCaseSensitive(\Doctrine\DBAL\Platforms\MySQLPlatform::class) && is_a($platform, \Doctrine\DBAL\Platforms\MySQLPlatform::class, true)) { return true; } - /** - * @phpstan-ignore-next-line - * - * @psalm-suppress InvalidClass - */ + /** @phpstan-ignore-next-line */ if ($this->classExistsCaseSensitive(\Doctrine\DBAL\Platforms\MySqlPlatform::class) && is_a($platform, \Doctrine\DBAL\Platforms\MySqlPlatform::class, true)) { return true; } diff --git a/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/SqlWalker/OrderByIdentifierSqlWalker.php b/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/SqlWalker/OrderByIdentifierSqlWalker.php index addd2c4889b..1b5e1a5fc51 100644 --- a/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/SqlWalker/OrderByIdentifierSqlWalker.php +++ b/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/SqlWalker/OrderByIdentifierSqlWalker.php @@ -78,7 +78,6 @@ private function createOrderByItem(string $dqlAlias, string $fieldName): OrderBy */ private function getDqlAlias(): ?string { - /** @psalm-suppress UndefinedDocblockClass */ foreach ($this->getQueryComponents() as $dqlAlias => $queryComponent) { if ( isset($queryComponent['metadata']) && diff --git a/src/Sylius/Bundle/CoreBundle/EventListener/CircularDependencyBreakingErrorListener.php b/src/Sylius/Bundle/CoreBundle/EventListener/CircularDependencyBreakingErrorListener.php index 21b66d39c40..c632134c36c 100644 --- a/src/Sylius/Bundle/CoreBundle/EventListener/CircularDependencyBreakingErrorListener.php +++ b/src/Sylius/Bundle/CoreBundle/EventListener/CircularDependencyBreakingErrorListener.php @@ -59,11 +59,7 @@ public function logKernelException(ExceptionEvent $event): void public function onKernelException(ExceptionEvent $event, string $eventName = null, EventDispatcherInterface $eventDispatcher = null): void { try { - /** - * @psalm-suppress TooManyArguments - * - * @phpstan-ignore-next-line - */ + /** @phpstan-ignore-next-line */ $this->decoratedListener->onKernelException($event, $eventName, $eventDispatcher); } catch (\Throwable $throwable) { $this->breakCircularDependency($throwable); diff --git a/src/Sylius/Bundle/CoreBundle/Form/Extension/LocaleTypeExtension.php b/src/Sylius/Bundle/CoreBundle/Form/Extension/LocaleTypeExtension.php index 51457b3557f..d11962c302d 100644 --- a/src/Sylius/Bundle/CoreBundle/Form/Extension/LocaleTypeExtension.php +++ b/src/Sylius/Bundle/CoreBundle/Form/Extension/LocaleTypeExtension.php @@ -40,7 +40,6 @@ public function buildForm(FormBuilderInterface $builder, array $options): void if ($locale instanceof LocaleInterface && null !== $locale->getCode()) { $options['disabled'] = true; - /** @psalm-suppress InvalidArrayOffset */ $options['choices'] = [$this->getLocaleName($locale->getCode()) => $locale->getCode()]; } else { $options['choices'] = array_flip($this->getAvailableLocales()); diff --git a/src/Sylius/Bundle/CoreBundle/Form/Type/Product/ProductImageType.php b/src/Sylius/Bundle/CoreBundle/Form/Type/Product/ProductImageType.php index 6c0015b85f9..3486d0144eb 100644 --- a/src/Sylius/Bundle/CoreBundle/Form/Type/Product/ProductImageType.php +++ b/src/Sylius/Bundle/CoreBundle/Form/Type/Product/ProductImageType.php @@ -41,9 +41,6 @@ public function buildForm(FormBuilderInterface $builder, array $options): void } } - /** - * @psalm-suppress MissingPropertyType - */ public function buildView(FormView $view, FormInterface $form, array $options): void { parent::buildView($view, $form, $options); diff --git a/src/Sylius/Bundle/CoreBundle/Installer/Provider/DatabaseSetupCommandsProvider.php b/src/Sylius/Bundle/CoreBundle/Installer/Provider/DatabaseSetupCommandsProvider.php index 67a88bc59e6..243f7db6751 100644 --- a/src/Sylius/Bundle/CoreBundle/Installer/Provider/DatabaseSetupCommandsProvider.php +++ b/src/Sylius/Bundle/CoreBundle/Installer/Provider/DatabaseSetupCommandsProvider.php @@ -97,7 +97,6 @@ private function getSchemaManager(): AbstractSchemaManager } if (method_exists($connection, 'getSchemaManager')) { - /** @psalm-suppress DeprecatedMethod */ return $connection->getSchemaManager(); } diff --git a/src/Sylius/Bundle/CoreBundle/Migrations/Version20220407131547.php b/src/Sylius/Bundle/CoreBundle/Migrations/Version20220407131547.php index d35a5100395..1287a1b8aa1 100644 --- a/src/Sylius/Bundle/CoreBundle/Migrations/Version20220407131547.php +++ b/src/Sylius/Bundle/CoreBundle/Migrations/Version20220407131547.php @@ -54,7 +54,6 @@ private function getExistingIndexesNames(string $tableName): array if (method_exists($this->connection, 'createSchemaManager')) { $indexes = $this->connection->createSchemaManager()->listTableIndexes($tableName); } else { - /** @psalm-suppress DeprecatedMethod */ $indexes = $this->connection->getSchemaManager()->listTableIndexes($tableName); } $indexesNames = []; diff --git a/src/Sylius/Bundle/CoreBundle/SyliusCoreBundle.php b/src/Sylius/Bundle/CoreBundle/SyliusCoreBundle.php index 061a73a8f75..d97b8ffbcdc 100644 --- a/src/Sylius/Bundle/CoreBundle/SyliusCoreBundle.php +++ b/src/Sylius/Bundle/CoreBundle/SyliusCoreBundle.php @@ -95,9 +95,6 @@ public function build(ContainerBuilder $container): void $container->addCompilerPass(new CancelOrderStateMachineCallbackPass()); } - /** - * @psalm-suppress MismatchingDocblockReturnType https://github.com/vimeo/psalm/issues/2345 - */ protected function getModelNamespace(): string { return 'Sylius\Component\Core\Model'; diff --git a/src/Sylius/Bundle/CoreBundle/Twig/FilterExtension.php b/src/Sylius/Bundle/CoreBundle/Twig/FilterExtension.php index f7dedf3bd9d..fa73f116043 100644 --- a/src/Sylius/Bundle/CoreBundle/Twig/FilterExtension.php +++ b/src/Sylius/Bundle/CoreBundle/Twig/FilterExtension.php @@ -17,14 +17,10 @@ use Liip\ImagineBundle\Templating\FilterExtension as BaseFilterExtension; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; -/** - * @psalm-suppress DeprecatedClass - */ final class FilterExtension extends BaseFilterExtension { public function __construct(private string $imagesPath, CacheManager $cache) { - /** @psalm-suppress DeprecatedClass */ parent::__construct($cache); } @@ -39,7 +35,6 @@ public function filter( return $this->imagesPath . $path; } - /** @psalm-suppress DeprecatedClass */ return parent::filter($path, $filter, $config, $resolver, $referenceType); } diff --git a/src/Sylius/Bundle/CurrencyBundle/SyliusCurrencyBundle.php b/src/Sylius/Bundle/CurrencyBundle/SyliusCurrencyBundle.php index fd2b47c9f22..b7208c2a0de 100644 --- a/src/Sylius/Bundle/CurrencyBundle/SyliusCurrencyBundle.php +++ b/src/Sylius/Bundle/CurrencyBundle/SyliusCurrencyBundle.php @@ -35,9 +35,6 @@ public function getSupportedDrivers(): array ]; } - /** - * @psalm-suppress MismatchingDocblockReturnType https://github.com/vimeo/psalm/issues/2345 - */ protected function getModelNamespace(): string { return 'Sylius\Component\Currency\Model'; diff --git a/src/Sylius/Bundle/CustomerBundle/SyliusCustomerBundle.php b/src/Sylius/Bundle/CustomerBundle/SyliusCustomerBundle.php index 859cd2c1995..7446ff09ec5 100644 --- a/src/Sylius/Bundle/CustomerBundle/SyliusCustomerBundle.php +++ b/src/Sylius/Bundle/CustomerBundle/SyliusCustomerBundle.php @@ -25,9 +25,6 @@ public function getSupportedDrivers(): array ]; } - /** - * @psalm-suppress MismatchingDocblockReturnType https://github.com/vimeo/psalm/issues/2345 - */ protected function getModelNamespace(): string { return 'Sylius\Component\Customer\Model'; diff --git a/src/Sylius/Bundle/InventoryBundle/SyliusInventoryBundle.php b/src/Sylius/Bundle/InventoryBundle/SyliusInventoryBundle.php index fdf3b34e3c9..8a1eb399a2b 100644 --- a/src/Sylius/Bundle/InventoryBundle/SyliusInventoryBundle.php +++ b/src/Sylius/Bundle/InventoryBundle/SyliusInventoryBundle.php @@ -26,9 +26,6 @@ public function getSupportedDrivers(): array ]; } - /** - * @psalm-suppress MismatchingDocblockReturnType https://github.com/vimeo/psalm/issues/2345 - */ protected function getModelNamespace(): string { return 'Sylius\Component\Inventory\Model'; diff --git a/src/Sylius/Bundle/LocaleBundle/SyliusLocaleBundle.php b/src/Sylius/Bundle/LocaleBundle/SyliusLocaleBundle.php index eb79743654d..e79f6077be6 100644 --- a/src/Sylius/Bundle/LocaleBundle/SyliusLocaleBundle.php +++ b/src/Sylius/Bundle/LocaleBundle/SyliusLocaleBundle.php @@ -35,9 +35,6 @@ public function getSupportedDrivers(): array ]; } - /** - * @psalm-suppress MismatchingDocblockReturnType https://github.com/vimeo/psalm/issues/2345 - */ protected function getModelNamespace(): string { return 'Sylius\Component\Locale\Model'; diff --git a/src/Sylius/Bundle/MoneyBundle/Form/DataTransformer/SyliusMoneyTransformer.php b/src/Sylius/Bundle/MoneyBundle/Form/DataTransformer/SyliusMoneyTransformer.php index 66179523092..2ec06199829 100644 --- a/src/Sylius/Bundle/MoneyBundle/Form/DataTransformer/SyliusMoneyTransformer.php +++ b/src/Sylius/Bundle/MoneyBundle/Form/DataTransformer/SyliusMoneyTransformer.php @@ -17,7 +17,6 @@ final class SyliusMoneyTransformer extends MoneyToLocalizedStringTransformer { - /** @psalm-suppress ImplementedReturnTypeMismatch Parent class from Symfony returns null but does not include it in the docblock */ public function reverseTransform($value): ?int { /** @var int|float|null $value */ diff --git a/src/Sylius/Bundle/MoneyBundle/Form/Type/MoneyType.php b/src/Sylius/Bundle/MoneyBundle/Form/Type/MoneyType.php index 55dc3284f3a..c562f834ff8 100644 --- a/src/Sylius/Bundle/MoneyBundle/Form/Type/MoneyType.php +++ b/src/Sylius/Bundle/MoneyBundle/Form/Type/MoneyType.php @@ -35,9 +35,6 @@ public function buildForm(FormBuilderInterface $builder, array $options): void ; } - /** - * @psalm-suppress MissingPropertyType - */ public function buildView(FormView $view, FormInterface $form, array $options): void { $view->vars['currency'] = $options['currency']; diff --git a/src/Sylius/Bundle/OrderBundle/Controller/OrderController.php b/src/Sylius/Bundle/OrderBundle/Controller/OrderController.php index ae1f2dc9540..b2e616c312a 100644 --- a/src/Sylius/Bundle/OrderBundle/Controller/OrderController.php +++ b/src/Sylius/Bundle/OrderBundle/Controller/OrderController.php @@ -143,9 +143,6 @@ private function resetChangesOnCart(OrderInterface $cart): void } } - /** - * @psalm-suppress DeprecatedMethod - */ public function clearAction(Request $request): Response { $configuration = $this->requestConfigurationFactory->create($this->metadata, $request); diff --git a/src/Sylius/Bundle/OrderBundle/SyliusOrderBundle.php b/src/Sylius/Bundle/OrderBundle/SyliusOrderBundle.php index 2889f6c7b00..b8f4fa91269 100644 --- a/src/Sylius/Bundle/OrderBundle/SyliusOrderBundle.php +++ b/src/Sylius/Bundle/OrderBundle/SyliusOrderBundle.php @@ -38,9 +38,6 @@ public function build(ContainerBuilder $container): void $container->addCompilerPass(new TagResettableCartContextsPass()); } - /** - * @psalm-suppress MismatchingDocblockReturnType https://github.com/vimeo/psalm/issues/2345 - */ protected function getModelNamespace(): string { return 'Sylius\Component\Order\Model'; diff --git a/src/Sylius/Bundle/PaymentBundle/SyliusPaymentBundle.php b/src/Sylius/Bundle/PaymentBundle/SyliusPaymentBundle.php index af960e42626..9003451fc22 100644 --- a/src/Sylius/Bundle/PaymentBundle/SyliusPaymentBundle.php +++ b/src/Sylius/Bundle/PaymentBundle/SyliusPaymentBundle.php @@ -37,9 +37,6 @@ public function build(ContainerBuilder $container): void $container->addCompilerPass(new RegisterPaymentMethodsResolversPass()); } - /** - * @psalm-suppress MismatchingDocblockReturnType https://github.com/vimeo/psalm/issues/2345 - */ protected function getModelNamespace(): string { return 'Sylius\Component\Payment\Model'; diff --git a/src/Sylius/Bundle/PayumBundle/Action/Offline/StatusAction.php b/src/Sylius/Bundle/PayumBundle/Action/Offline/StatusAction.php index cc5d67ab8e2..404275c162c 100644 --- a/src/Sylius/Bundle/PayumBundle/Action/Offline/StatusAction.php +++ b/src/Sylius/Bundle/PayumBundle/Action/Offline/StatusAction.php @@ -28,7 +28,6 @@ public function execute($request): void $model = ArrayObject::ensureArrayObject($request->getModel()); - /** @psalm-suppress DocblockTypeContradiction */ if (false === $model[Constants::FIELD_STATUS]) { $request->markNew(); diff --git a/src/Sylius/Bundle/PayumBundle/Request/GetStatus.php b/src/Sylius/Bundle/PayumBundle/Request/GetStatus.php index 51831cdd507..e834c380dcf 100644 --- a/src/Sylius/Bundle/PayumBundle/Request/GetStatus.php +++ b/src/Sylius/Bundle/PayumBundle/Request/GetStatus.php @@ -19,8 +19,6 @@ class GetStatus extends BaseGetStatus { /** - * @psalm-suppress NonInvariantDocblockPropertyType - * * @phpstan-ignore-next-line * * @var string diff --git a/src/Sylius/Bundle/ProductBundle/Controller/ProductSlugController.php b/src/Sylius/Bundle/ProductBundle/Controller/ProductSlugController.php index ebe91d258d0..92cf79f563c 100644 --- a/src/Sylius/Bundle/ProductBundle/Controller/ProductSlugController.php +++ b/src/Sylius/Bundle/ProductBundle/Controller/ProductSlugController.php @@ -28,9 +28,6 @@ public function __construct(private ?SlugGeneratorInterface $slugGenerator = nul } } - /** - * @psalm-suppress DeprecatedMethod - */ public function generateAction(Request $request): Response { $name = $request->query->get('name'); diff --git a/src/Sylius/Bundle/ProductBundle/Form/DataTransformer/ProductsToProductAssociationsTransformer.php b/src/Sylius/Bundle/ProductBundle/Form/DataTransformer/ProductsToProductAssociationsTransformer.php index 209dc8c4b81..1b800272986 100644 --- a/src/Sylius/Bundle/ProductBundle/Form/DataTransformer/ProductsToProductAssociationsTransformer.php +++ b/src/Sylius/Bundle/ProductBundle/Form/DataTransformer/ProductsToProductAssociationsTransformer.php @@ -26,11 +26,7 @@ final class ProductsToProductAssociationsTransformer implements DataTransformerInterface { - /** - * @var Collection|ProductAssociationInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ private ?Collection $productAssociations = null; public function __construct( @@ -66,9 +62,7 @@ public function reverseTransform($value): ?Collection return null; } - /** - * @psalm-var Collection $productAssociations - */ + /** @var Collection $productAssociations */ $productAssociations = new ArrayCollection(); foreach ($value as $productAssociationTypeCode => $productCodes) { if (null === $productCodes) { diff --git a/src/Sylius/Bundle/ProductBundle/Form/Type/ProductAutocompleteChoiceType.php b/src/Sylius/Bundle/ProductBundle/Form/Type/ProductAutocompleteChoiceType.php index 881173bdeac..cf9c781f8a6 100644 --- a/src/Sylius/Bundle/ProductBundle/Form/Type/ProductAutocompleteChoiceType.php +++ b/src/Sylius/Bundle/ProductBundle/Form/Type/ProductAutocompleteChoiceType.php @@ -30,9 +30,6 @@ public function configureOptions(OptionsResolver $resolver): void ]); } - /** - * @psalm-suppress MissingPropertyType - */ public function buildView(FormView $view, FormInterface $form, array $options): void { $view->vars['remote_criteria_type'] = 'contains'; diff --git a/src/Sylius/Bundle/ProductBundle/Form/Type/ProductOptionAutocompleteType.php b/src/Sylius/Bundle/ProductBundle/Form/Type/ProductOptionAutocompleteType.php index 519b83e620a..edc5f89af5d 100644 --- a/src/Sylius/Bundle/ProductBundle/Form/Type/ProductOptionAutocompleteType.php +++ b/src/Sylius/Bundle/ProductBundle/Form/Type/ProductOptionAutocompleteType.php @@ -30,9 +30,6 @@ public function configureOptions(OptionsResolver $resolver): void ]); } - /** - * @psalm-suppress MissingPropertyType - */ public function buildView(FormView $view, FormInterface $form, array $options): void { $view->vars['remote_criteria_type'] = 'contains'; diff --git a/src/Sylius/Bundle/ProductBundle/SyliusProductBundle.php b/src/Sylius/Bundle/ProductBundle/SyliusProductBundle.php index 3c96abbbdcb..8f4af32e73a 100644 --- a/src/Sylius/Bundle/ProductBundle/SyliusProductBundle.php +++ b/src/Sylius/Bundle/ProductBundle/SyliusProductBundle.php @@ -25,9 +25,6 @@ public function getSupportedDrivers(): array ]; } - /** - * @psalm-suppress MismatchingDocblockReturnType https://github.com/vimeo/psalm/issues/2345 - */ protected function getModelNamespace(): string { return 'Sylius\Component\Product\Model'; diff --git a/src/Sylius/Bundle/PromotionBundle/Form/Type/Core/AbstractConfigurationCollectionType.php b/src/Sylius/Bundle/PromotionBundle/Form/Type/Core/AbstractConfigurationCollectionType.php index 70e86d5fe6d..f70dbe8d6d9 100644 --- a/src/Sylius/Bundle/PromotionBundle/Form/Type/Core/AbstractConfigurationCollectionType.php +++ b/src/Sylius/Bundle/PromotionBundle/Form/Type/Core/AbstractConfigurationCollectionType.php @@ -46,9 +46,6 @@ public function buildForm(FormBuilderInterface $builder, array $options): void $builder->setAttribute('prototypes', $prototypes); } - /** - * @psalm-suppress MissingPropertyType - */ public function buildView(FormView $view, FormInterface $form, array $options): void { $view->vars['prototypes'] = []; diff --git a/src/Sylius/Bundle/PromotionBundle/SyliusPromotionBundle.php b/src/Sylius/Bundle/PromotionBundle/SyliusPromotionBundle.php index 2f353074edf..3ee4d43ff1d 100644 --- a/src/Sylius/Bundle/PromotionBundle/SyliusPromotionBundle.php +++ b/src/Sylius/Bundle/PromotionBundle/SyliusPromotionBundle.php @@ -46,9 +46,6 @@ public function build(ContainerBuilder $container): void $container->addCompilerPass(new SetCatalogPromotionScopeTypesPass()); } - /** - * @psalm-suppress MismatchingDocblockReturnType https://github.com/vimeo/psalm/issues/2345 - */ protected function getModelNamespace(): string { return 'Sylius\Component\Promotion\Model'; diff --git a/src/Sylius/Bundle/PromotionBundle/test/src/AppBundle/Entity/PromotionSubject.php b/src/Sylius/Bundle/PromotionBundle/test/src/AppBundle/Entity/PromotionSubject.php index aba2a8b4c7f..d69ccf4a451 100644 --- a/src/Sylius/Bundle/PromotionBundle/test/src/AppBundle/Entity/PromotionSubject.php +++ b/src/Sylius/Bundle/PromotionBundle/test/src/AppBundle/Entity/PromotionSubject.php @@ -22,11 +22,7 @@ class PromotionSubject implements ResourceInterface, PromotionSubjectInterface { private int $id; - /** - * @var Collection|PromotionInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $promotions; public function getId(): int diff --git a/src/Sylius/Bundle/ReviewBundle/SyliusReviewBundle.php b/src/Sylius/Bundle/ReviewBundle/SyliusReviewBundle.php index 92fb2eba68f..fdeee89f4a0 100644 --- a/src/Sylius/Bundle/ReviewBundle/SyliusReviewBundle.php +++ b/src/Sylius/Bundle/ReviewBundle/SyliusReviewBundle.php @@ -34,9 +34,6 @@ public function build(ContainerBuilder $container): void $container->addCompilerPass(new RegisterReviewFactoryPass()); } - /** - * @psalm-suppress MismatchingDocblockReturnType https://github.com/vimeo/psalm/issues/2345 - */ protected function getModelNamespace(): string { return 'Sylius\Component\Review\Model'; diff --git a/src/Sylius/Bundle/ShippingBundle/Form/Type/Core/AbstractConfigurationCollectionType.php b/src/Sylius/Bundle/ShippingBundle/Form/Type/Core/AbstractConfigurationCollectionType.php index 751e0ad4100..61a3e9f45f0 100644 --- a/src/Sylius/Bundle/ShippingBundle/Form/Type/Core/AbstractConfigurationCollectionType.php +++ b/src/Sylius/Bundle/ShippingBundle/Form/Type/Core/AbstractConfigurationCollectionType.php @@ -46,9 +46,6 @@ public function buildForm(FormBuilderInterface $builder, array $options): void $builder->setAttribute('prototypes', $prototypes); } - /** - * @psalm-suppress MissingPropertyType - */ public function buildView(FormView $view, FormInterface $form, array $options): void { $view->vars['prototypes'] = []; diff --git a/src/Sylius/Bundle/ShippingBundle/Form/Type/ShippingMethodChoiceType.php b/src/Sylius/Bundle/ShippingBundle/Form/Type/ShippingMethodChoiceType.php index 39c36192823..9b44fbcc850 100644 --- a/src/Sylius/Bundle/ShippingBundle/Form/Type/ShippingMethodChoiceType.php +++ b/src/Sylius/Bundle/ShippingBundle/Form/Type/ShippingMethodChoiceType.php @@ -67,9 +67,6 @@ public function configureOptions(OptionsResolver $resolver): void ; } - /** - * @psalm-suppress MissingPropertyType - */ public function buildView(FormView $view, FormInterface $form, array $options): void { if (!isset($options['subject'])) { diff --git a/src/Sylius/Bundle/ShippingBundle/Form/Type/ShippingMethodType.php b/src/Sylius/Bundle/ShippingBundle/Form/Type/ShippingMethodType.php index 738b02e668d..d6b7660005f 100644 --- a/src/Sylius/Bundle/ShippingBundle/Form/Type/ShippingMethodType.php +++ b/src/Sylius/Bundle/ShippingBundle/Form/Type/ShippingMethodType.php @@ -116,9 +116,6 @@ public function buildForm(FormBuilderInterface $builder, array $options): void $builder->setAttribute('prototypes', $prototypes); } - /** - * @psalm-suppress MissingPropertyType - */ public function buildView(FormView $view, FormInterface $form, array $options): void { $view->vars['rules_help'] = $options['rules_help'] ?? ''; diff --git a/src/Sylius/Bundle/ShippingBundle/SyliusShippingBundle.php b/src/Sylius/Bundle/ShippingBundle/SyliusShippingBundle.php index 746920412f9..6536e8da011 100644 --- a/src/Sylius/Bundle/ShippingBundle/SyliusShippingBundle.php +++ b/src/Sylius/Bundle/ShippingBundle/SyliusShippingBundle.php @@ -40,9 +40,6 @@ public function build(ContainerBuilder $container): void $container->addCompilerPass(new RegisterShippingMethodsResolversPass()); } - /** - * @psalm-suppress MismatchingDocblockReturnType https://github.com/vimeo/psalm/issues/2345 - */ protected function getModelNamespace(): string { return 'Sylius\Component\Shipping\Model'; diff --git a/src/Sylius/Bundle/TaxationBundle/SyliusTaxationBundle.php b/src/Sylius/Bundle/TaxationBundle/SyliusTaxationBundle.php index 29cde5ac3e3..5d1bc78b71c 100644 --- a/src/Sylius/Bundle/TaxationBundle/SyliusTaxationBundle.php +++ b/src/Sylius/Bundle/TaxationBundle/SyliusTaxationBundle.php @@ -34,9 +34,6 @@ public function build(ContainerBuilder $container): void $container->addCompilerPass(new RegisterCalculatorsPass()); } - /** - * @psalm-suppress MismatchingDocblockReturnType https://github.com/vimeo/psalm/issues/2345 - */ protected function getModelNamespace(): string { return 'Sylius\Component\Taxation\Model'; diff --git a/src/Sylius/Bundle/TaxonomyBundle/Form/Type/TaxonAutocompleteChoiceType.php b/src/Sylius/Bundle/TaxonomyBundle/Form/Type/TaxonAutocompleteChoiceType.php index f3b0c85b304..ac2989f6957 100644 --- a/src/Sylius/Bundle/TaxonomyBundle/Form/Type/TaxonAutocompleteChoiceType.php +++ b/src/Sylius/Bundle/TaxonomyBundle/Form/Type/TaxonAutocompleteChoiceType.php @@ -30,9 +30,6 @@ public function configureOptions(OptionsResolver $resolver): void ]); } - /** - * @psalm-suppress MissingPropertyType - */ public function buildView(FormView $view, FormInterface $form, array $options): void { $view->vars['remote_criteria_type'] = 'contains'; diff --git a/src/Sylius/Bundle/TaxonomyBundle/Repository/TaxonTreeRepository.php b/src/Sylius/Bundle/TaxonomyBundle/Repository/TaxonTreeRepository.php index 012d98269cc..ccc6381ea8d 100644 --- a/src/Sylius/Bundle/TaxonomyBundle/Repository/TaxonTreeRepository.php +++ b/src/Sylius/Bundle/TaxonomyBundle/Repository/TaxonTreeRepository.php @@ -14,9 +14,13 @@ namespace Sylius\Bundle\TaxonomyBundle\Repository; use Gedmo\Tree\Entity\Repository\NestedTreeRepository; +use Sylius\Component\Taxonomy\Model\TaxonInterface; class TaxonTreeRepository implements TaxonTreeRepositoryInterface { + /** + * @param NestedTreeRepository $nestedTreeRepository + */ public function __construct( private NestedTreeRepository $nestedTreeRepository, ) { diff --git a/src/Sylius/Bundle/TaxonomyBundle/SyliusTaxonomyBundle.php b/src/Sylius/Bundle/TaxonomyBundle/SyliusTaxonomyBundle.php index 1f23658fad1..fd3e9f67c6a 100644 --- a/src/Sylius/Bundle/TaxonomyBundle/SyliusTaxonomyBundle.php +++ b/src/Sylius/Bundle/TaxonomyBundle/SyliusTaxonomyBundle.php @@ -26,9 +26,6 @@ public function getSupportedDrivers(): array ]; } - /** - * @psalm-suppress MismatchingDocblockReturnType https://github.com/vimeo/psalm/issues/2345 - */ protected function getModelNamespace(): string { return 'Sylius\Component\Taxonomy\Model'; diff --git a/src/Sylius/Bundle/UiBundle/DataCollector/TemplateBlockRenderingHistory.php b/src/Sylius/Bundle/UiBundle/DataCollector/TemplateBlockRenderingHistory.php index 41da2e59a0f..15a0838c0dd 100644 --- a/src/Sylius/Bundle/UiBundle/DataCollector/TemplateBlockRenderingHistory.php +++ b/src/Sylius/Bundle/UiBundle/DataCollector/TemplateBlockRenderingHistory.php @@ -18,13 +18,13 @@ /** @internal */ final class TemplateBlockRenderingHistory { - /** @psalm-var list}> */ + /** @var array}> */ private $renderedEvents = []; - /** @psalm-var list}> */ + /** @var array}> */ private array $currentlyRenderedEvents = []; - /** @psalm-var list */ + /** @var array */ private array $currentlyRenderedBlocks = []; public function startRenderingEvent(array $eventNames, array $context): void diff --git a/src/Sylius/Bundle/UiBundle/DependencyInjection/SyliusUiExtension.php b/src/Sylius/Bundle/UiBundle/DependencyInjection/SyliusUiExtension.php index 507d432e5ed..4ec6c9784cc 100644 --- a/src/Sylius/Bundle/UiBundle/DependencyInjection/SyliusUiExtension.php +++ b/src/Sylius/Bundle/UiBundle/DependencyInjection/SyliusUiExtension.php @@ -40,7 +40,7 @@ public function load(array $configs, ContainerBuilder $container): void } /** - * @psalm-param array}> $eventsConfig + * @param array}> $eventsConfig */ private function loadEvents(array $eventsConfig, ContainerBuilder $container): void { @@ -58,7 +58,7 @@ private function loadEvents(array $eventsConfig, ContainerBuilder $container): v } foreach ($blocksPriorityQueue->toArray() as $details) { - /** @psalm-var array{name: string, eventName: string, template: string, context: array, priority: int, enabled: bool} $details */ + /** @var array{name: string, eventName: string, template: string, context: array, priority: int, enabled: bool} $details */ $blocksForEvents[$eventName][$details['name']] = new Definition(TemplateBlock::class, [ $details['name'], $details['eventName'], diff --git a/src/Sylius/Bundle/UiBundle/Registry/TemplateBlockRegistry.php b/src/Sylius/Bundle/UiBundle/Registry/TemplateBlockRegistry.php index 6b8dd17693a..00929eac7a3 100644 --- a/src/Sylius/Bundle/UiBundle/Registry/TemplateBlockRegistry.php +++ b/src/Sylius/Bundle/UiBundle/Registry/TemplateBlockRegistry.php @@ -20,9 +20,7 @@ final class TemplateBlockRegistry implements TemplateBlockRegistryInterface /** * Blocks within an event should be sorted by their priority descending. * - * @var TemplateBlock[][] - * - * @psalm-var array> + * @var array> */ private $eventsToTemplateBlocks; @@ -62,19 +60,13 @@ public function findEnabledForEvents(array $eventNames): array } /** - * @param string[] $eventNames - * - * @psalm-param non-empty-list $eventNames + * @param non-empty-list $eventNames * * @return TemplateBlock[] */ private function findFinalizedForEvents(array $eventNames): array { - /** - * @var TemplateBlock[] $finalizedTemplateBlocks - * - * @psalm-var array $finalizedTemplateBlocks - */ + /** @var array $finalizedTemplateBlocks */ $finalizedTemplateBlocks = []; $reversedEventNames = array_reverse($eventNames); foreach ($reversedEventNames as $eventName) { diff --git a/src/Sylius/Bundle/UiBundle/Registry/TemplateBlockRegistryInterface.php b/src/Sylius/Bundle/UiBundle/Registry/TemplateBlockRegistryInterface.php index c6335ca4108..ff320034be5 100644 --- a/src/Sylius/Bundle/UiBundle/Registry/TemplateBlockRegistryInterface.php +++ b/src/Sylius/Bundle/UiBundle/Registry/TemplateBlockRegistryInterface.php @@ -16,20 +16,14 @@ interface TemplateBlockRegistryInterface { /** - * @return TemplateBlock[][] - * - * @psalm-return array> + * @return array> */ public function all(): array; /** - * @param string[] $eventNames - * - * @psalm-param non-empty-list $eventNames + * @param non-empty-list $eventNames * * @return TemplateBlock[] - * - * @psalm-return list */ public function findEnabledForEvents(array $eventNames): array; } diff --git a/src/Sylius/Bundle/UiBundle/Renderer/TemplateEventRendererInterface.php b/src/Sylius/Bundle/UiBundle/Renderer/TemplateEventRendererInterface.php index 6b5ac058499..801d393c59c 100644 --- a/src/Sylius/Bundle/UiBundle/Renderer/TemplateEventRendererInterface.php +++ b/src/Sylius/Bundle/UiBundle/Renderer/TemplateEventRendererInterface.php @@ -16,9 +16,7 @@ interface TemplateEventRendererInterface { /** - * @param string[] $eventNames - * - * @psalm-param non-empty-list $eventNames + * @param non-empty-list $eventNames */ public function render(array $eventNames, array $context = []): string; } diff --git a/src/Sylius/Bundle/UserBundle/Controller/SecurityController.php b/src/Sylius/Bundle/UserBundle/Controller/SecurityController.php index e6adfa15a52..315f3cbb417 100644 --- a/src/Sylius/Bundle/UserBundle/Controller/SecurityController.php +++ b/src/Sylius/Bundle/UserBundle/Controller/SecurityController.php @@ -38,8 +38,6 @@ public function __construct( /** * Login form action. - * - * @psalm-suppress DeprecatedMethod */ public function loginAction(Request $request): Response { diff --git a/src/Sylius/Bundle/UserBundle/Security/UserLogin.php b/src/Sylius/Bundle/UserBundle/Security/UserLogin.php index 93b94fabbfd..da279130498 100644 --- a/src/Sylius/Bundle/UserBundle/Security/UserLogin.php +++ b/src/Sylius/Bundle/UserBundle/Security/UserLogin.php @@ -62,7 +62,6 @@ protected function createToken(UserInterface $user, string $firewallName): Usern ); } - /** @psalm-suppress NullArgument */ return new UsernamePasswordToken( $user, null, // @phpstan-ignore-line continue to support Sf < 6 diff --git a/src/Sylius/Bundle/UserBundle/Security/UserPasswordEncoder.php b/src/Sylius/Bundle/UserBundle/Security/UserPasswordEncoder.php index 96091e7244b..dea290c01b4 100644 --- a/src/Sylius/Bundle/UserBundle/Security/UserPasswordEncoder.php +++ b/src/Sylius/Bundle/UserBundle/Security/UserPasswordEncoder.php @@ -43,10 +43,6 @@ public function __construct(private EncoderFactoryInterface|PasswordHasherFactor public function encode(CredentialsHolderInterface $user): string { - /** - * @psalm-suppress InvalidArgument - * @psalm-suppress UndefinedMethod - */ $encoder = $this->encoderOrPasswordHasherFactory->getEncoder($user); return $encoder->encodePassword($user->getPlainPassword(), $user->getSalt()); diff --git a/src/Sylius/Bundle/UserBundle/Security/UserPasswordHasher.php b/src/Sylius/Bundle/UserBundle/Security/UserPasswordHasher.php index 6706f5b9839..b59558737c3 100644 --- a/src/Sylius/Bundle/UserBundle/Security/UserPasswordHasher.php +++ b/src/Sylius/Bundle/UserBundle/Security/UserPasswordHasher.php @@ -25,7 +25,6 @@ public function __construct(private PasswordHasherFactoryInterface $passwordHash public function hash(CredentialsHolderInterface $user): string { - /** @psalm-suppress InvalidArgument */ $passwordHasher = $this->passwordHasherFactory->getPasswordHasher($user::class); /** diff --git a/src/Sylius/Bundle/UserBundle/SyliusUserBundle.php b/src/Sylius/Bundle/UserBundle/SyliusUserBundle.php index 51d5d7bd9a8..3df2726fdff 100644 --- a/src/Sylius/Bundle/UserBundle/SyliusUserBundle.php +++ b/src/Sylius/Bundle/UserBundle/SyliusUserBundle.php @@ -34,9 +34,6 @@ public function build(ContainerBuilder $container): void $container->addCompilerPass(new RemoveUserPasswordEncoderPass()); } - /** - * @psalm-suppress MismatchingDocblockReturnType https://github.com/vimeo/psalm/issues/2345 - */ protected function getModelNamespace(): string { return 'Sylius\Component\User\Model'; diff --git a/src/Sylius/Component/Addressing/Model/Country.php b/src/Sylius/Component/Addressing/Model/Country.php index e95aafdd286..cf3838cf8b7 100644 --- a/src/Sylius/Component/Addressing/Model/Country.php +++ b/src/Sylius/Component/Addressing/Model/Country.php @@ -32,11 +32,7 @@ class Country implements CountryInterface, \Stringable */ protected $code; - /** - * @var Collection|ProvinceInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $provinces; public function __construct() diff --git a/src/Sylius/Component/Addressing/Model/CountryInterface.php b/src/Sylius/Component/Addressing/Model/CountryInterface.php index 3aa098d89bb..206cc4735fd 100644 --- a/src/Sylius/Component/Addressing/Model/CountryInterface.php +++ b/src/Sylius/Component/Addressing/Model/CountryInterface.php @@ -23,9 +23,7 @@ interface CountryInterface extends ToggleableInterface, ResourceInterface, CodeA public function getName(?string $locale = null): ?string; /** - * @return Collection|ProvinceInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getProvinces(): Collection; diff --git a/src/Sylius/Component/Addressing/Model/Zone.php b/src/Sylius/Component/Addressing/Model/Zone.php index abba46548a9..e7935d6e9e0 100644 --- a/src/Sylius/Component/Addressing/Model/Zone.php +++ b/src/Sylius/Component/Addressing/Model/Zone.php @@ -33,11 +33,7 @@ class Zone implements ZoneInterface, \Stringable /** @var string */ protected $scope = Scope::ALL; - /** - * @var Collection|ZoneMemberInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $members; public function __construct() diff --git a/src/Sylius/Component/Addressing/Model/ZoneInterface.php b/src/Sylius/Component/Addressing/Model/ZoneInterface.php index 42e746147a1..f832accccac 100644 --- a/src/Sylius/Component/Addressing/Model/ZoneInterface.php +++ b/src/Sylius/Component/Addressing/Model/ZoneInterface.php @@ -43,9 +43,7 @@ public function getScope(): ?string; public function setScope(?string $scope): void; /** - * @return Collection|ZoneMemberInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getMembers(): Collection; diff --git a/src/Sylius/Component/Attribute/Model/AttributeSubjectInterface.php b/src/Sylius/Component/Attribute/Model/AttributeSubjectInterface.php index a8532208107..890076b6dff 100644 --- a/src/Sylius/Component/Attribute/Model/AttributeSubjectInterface.php +++ b/src/Sylius/Component/Attribute/Model/AttributeSubjectInterface.php @@ -18,16 +18,12 @@ interface AttributeSubjectInterface { /** - * @return Collection|AttributeValueInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getAttributes(): Collection; /** - * @return Collection|AttributeValueInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getAttributesByLocale( string $localeCode, diff --git a/src/Sylius/Component/Channel/Context/CompositeChannelContext.php b/src/Sylius/Component/Channel/Context/CompositeChannelContext.php index b9534483b00..7e921c48b5a 100644 --- a/src/Sylius/Component/Channel/Context/CompositeChannelContext.php +++ b/src/Sylius/Component/Channel/Context/CompositeChannelContext.php @@ -18,11 +18,7 @@ final class CompositeChannelContext implements ChannelContextInterface { - /** - * @var PriorityQueue|ChannelContextInterface[] - * - * @psalm-var PriorityQueue - */ + /** @var PriorityQueue */ private PriorityQueue $channelContexts; public function __construct() diff --git a/src/Sylius/Component/Channel/Context/RequestBased/CompositeRequestResolver.php b/src/Sylius/Component/Channel/Context/RequestBased/CompositeRequestResolver.php index 7f661cef765..6ec6a4b661c 100644 --- a/src/Sylius/Component/Channel/Context/RequestBased/CompositeRequestResolver.php +++ b/src/Sylius/Component/Channel/Context/RequestBased/CompositeRequestResolver.php @@ -19,11 +19,7 @@ final class CompositeRequestResolver implements RequestResolverInterface { - /** - * @var PriorityQueue|RequestResolverInterface[] - * - * @psalm-var PriorityQueue - */ + /** @var PriorityQueue */ private PriorityQueue $requestResolvers; public function __construct() diff --git a/src/Sylius/Component/Channel/Model/ChannelsAwareInterface.php b/src/Sylius/Component/Channel/Model/ChannelsAwareInterface.php index f7e0bada8ac..fa2d7470253 100644 --- a/src/Sylius/Component/Channel/Model/ChannelsAwareInterface.php +++ b/src/Sylius/Component/Channel/Model/ChannelsAwareInterface.php @@ -18,9 +18,7 @@ interface ChannelsAwareInterface { /** - * @return Collection|ChannelInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getChannels(): Collection; diff --git a/src/Sylius/Component/Core/Dashboard/SalesSummary.php b/src/Sylius/Component/Core/Dashboard/SalesSummary.php index ec27d3060c4..876c98b447d 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 { public function __construct( - /** @psalm-var array */ + /** @var array */ private array $intervalsSalesMap, ) { } diff --git a/src/Sylius/Component/Core/Model/CatalogPromotion.php b/src/Sylius/Component/Core/Model/CatalogPromotion.php index 3c1facf05ce..94650c2c481 100644 --- a/src/Sylius/Component/Core/Model/CatalogPromotion.php +++ b/src/Sylius/Component/Core/Model/CatalogPromotion.php @@ -22,11 +22,7 @@ class CatalogPromotion extends BaseCatalogPromotion implements CatalogPromotionInterface { - /** - * @var Collection - * - * @psalm-var Collection - */ + /** @var Collection */ protected Collection $channels; public function __construct() @@ -36,10 +32,6 @@ public function __construct() $this->channels = new ArrayCollection(); } - /** - * @psalm-suppress InvalidReturnType https://github.com/doctrine/collections/pull/220 - * @psalm-suppress InvalidReturnStatement https://github.com/doctrine/collections/pull/220 - */ public function getChannels(): Collection { /** @phpstan-ignore-next-line */ diff --git a/src/Sylius/Component/Core/Model/CatalogPromotionInterface.php b/src/Sylius/Component/Core/Model/CatalogPromotionInterface.php index 127c4d4be32..0f29cbb83aa 100644 --- a/src/Sylius/Component/Core/Model/CatalogPromotionInterface.php +++ b/src/Sylius/Component/Core/Model/CatalogPromotionInterface.php @@ -14,10 +14,14 @@ namespace Sylius\Component\Core\Model; use Doctrine\Common\Collections\Collection; +use Sylius\Component\Channel\Model\ChannelInterface; use Sylius\Component\Channel\Model\ChannelsAwareInterface; use Sylius\Component\Promotion\Model\CatalogPromotionInterface as BaseCatalogPromotionInterface; interface CatalogPromotionInterface extends BaseCatalogPromotionInterface, ChannelsAwareInterface { + /** + * @return Collection + */ public function getChannels(): Collection; } diff --git a/src/Sylius/Component/Core/Model/Channel.php b/src/Sylius/Component/Core/Model/Channel.php index 062ef374e9a..7ef2f4f9247 100644 --- a/src/Sylius/Component/Core/Model/Channel.php +++ b/src/Sylius/Component/Core/Model/Channel.php @@ -35,25 +35,13 @@ class Channel extends BaseChannel implements ChannelInterface /** @var string|null */ protected $taxCalculationStrategy; - /** - * @var Collection|CurrencyInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $currencies; - /** - * @var Collection|LocaleInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $locales; - /** - * @var Collection|CountryInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $countries; /** @var string|null */ diff --git a/src/Sylius/Component/Core/Model/ChannelInterface.php b/src/Sylius/Component/Core/Model/ChannelInterface.php index 26c35de8405..5b404de727b 100644 --- a/src/Sylius/Component/Core/Model/ChannelInterface.php +++ b/src/Sylius/Component/Core/Model/ChannelInterface.php @@ -80,9 +80,7 @@ public function getMenuTaxon(): ?TaxonInterface; public function setMenuTaxon(?TaxonInterface $menuTaxon): void; /** - * @return Collection|CountryInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getCountries(): Collection; diff --git a/src/Sylius/Component/Core/Model/ChannelPricing.php b/src/Sylius/Component/Core/Model/ChannelPricing.php index f6dc5fad86b..16eaacc2b23 100644 --- a/src/Sylius/Component/Core/Model/ChannelPricing.php +++ b/src/Sylius/Component/Core/Model/ChannelPricing.php @@ -36,11 +36,7 @@ class ChannelPricing implements ChannelPricingInterface, \Stringable /** @var int */ protected $minimumPrice = 0; - /** - * @var ArrayCollection - * - * @psalm-var ArrayCollection - */ + /** @var ArrayCollection */ protected $appliedPromotions; public function __construct() diff --git a/src/Sylius/Component/Core/Model/Customer.php b/src/Sylius/Component/Core/Model/Customer.php index 7860c0070de..f2fe5c0fb2c 100644 --- a/src/Sylius/Component/Core/Model/Customer.php +++ b/src/Sylius/Component/Core/Model/Customer.php @@ -21,21 +21,13 @@ class Customer extends BaseCustomer implements CustomerInterface { - /** - * @var Collection|OrderInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $orders; /** @var AddressInterface|null */ protected $defaultAddress; - /** - * @var Collection|AddressInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $addresses; /** @var ShopUserInterface|null */ @@ -112,7 +104,6 @@ public function setUser(?BaseUserInterface $user): void $previousUser = $this->user; $this->user = $user; - /** @psalm-suppress RedundantConditionGivenDocblockType */ if ($previousUser instanceof ShopUserInterface) { $previousUser->setCustomer(null); } diff --git a/src/Sylius/Component/Core/Model/CustomerInterface.php b/src/Sylius/Component/Core/Model/CustomerInterface.php index f44c658cd45..59ca1d6f482 100644 --- a/src/Sylius/Component/Core/Model/CustomerInterface.php +++ b/src/Sylius/Component/Core/Model/CustomerInterface.php @@ -21,9 +21,7 @@ interface CustomerInterface extends BaseCustomerInterface, UserAwareInterface, ProductReviewerInterface { /** - * @return Collection|OrderInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getOrders(): Collection; @@ -38,9 +36,7 @@ public function removeAddress(AddressInterface $address): void; public function hasAddress(AddressInterface $address): bool; /** - * @return Collection|AddressInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getAddresses(): Collection; diff --git a/src/Sylius/Component/Core/Model/ImagesAwareInterface.php b/src/Sylius/Component/Core/Model/ImagesAwareInterface.php index 19535ec1fed..6ce8f1250d1 100644 --- a/src/Sylius/Component/Core/Model/ImagesAwareInterface.php +++ b/src/Sylius/Component/Core/Model/ImagesAwareInterface.php @@ -18,16 +18,12 @@ interface ImagesAwareInterface { /** - * @return Collection|ImageInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getImages(): Collection; /** - * @return Collection|ImageInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getImagesByType(string $type): Collection; diff --git a/src/Sylius/Component/Core/Model/Order.php b/src/Sylius/Component/Core/Model/Order.php index 3aa2b975868..377d329a4ba 100644 --- a/src/Sylius/Component/Core/Model/Order.php +++ b/src/Sylius/Component/Core/Model/Order.php @@ -42,18 +42,10 @@ class Order extends BaseOrder implements OrderInterface /** @var AddressInterface|null */ protected $billingAddress; - /** - * @var Collection|PaymentInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $payments; - /** - * @var Collection|ShipmentInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $shipments; /** @var string|null */ @@ -74,11 +66,7 @@ class Order extends BaseOrder implements OrderInterface /** @var string */ protected $shippingState = OrderShippingStates::STATE_CART; - /** - * @var Collection|BasePromotionInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $promotions; /** @var string|null */ @@ -203,10 +191,6 @@ public function getItemUnitsByVariant(ProductVariantInterface $variant): Collect }); } - /** - * @psalm-suppress InvalidReturnType https://github.com/doctrine/collections/pull/220 - * @psalm-suppress InvalidReturnStatement https://github.com/doctrine/collections/pull/220 - */ public function getPayments(): Collection { /** @phpstan-ignore-next-line */ diff --git a/src/Sylius/Component/Core/Model/OrderInterface.php b/src/Sylius/Component/Core/Model/OrderInterface.php index 7a39621750d..7b68921299a 100644 --- a/src/Sylius/Component/Core/Model/OrderInterface.php +++ b/src/Sylius/Component/Core/Model/OrderInterface.php @@ -52,25 +52,19 @@ public function getPaymentState(): ?string; public function setPaymentState(?string $paymentState): void; /** - * @return Collection|OrderItemUnitInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getItemUnits(): Collection; /** - * @return Collection|OrderItemUnitInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getItemUnitsByVariant(ProductVariantInterface $variant): Collection; public function isShippingRequired(): bool; /** - * @return Collection|ShipmentInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getShipments(): Collection; @@ -127,13 +121,9 @@ public function getCreatedByGuest(): bool; public function setCreatedByGuest(bool $createdByGuest): void; /** - * @return Collection|OrderItemInterface[] - * - * @psalm-return Collection - * - * @psalm-suppress ImplementedReturnTypeMismatch - * * @phpstan-ignore-next-line + * + * @return Collection */ public function getItems(): Collection; diff --git a/src/Sylius/Component/Core/Model/PaymentMethod.php b/src/Sylius/Component/Core/Model/PaymentMethod.php index 094b2d23be7..206a5638f81 100644 --- a/src/Sylius/Component/Core/Model/PaymentMethod.php +++ b/src/Sylius/Component/Core/Model/PaymentMethod.php @@ -22,11 +22,7 @@ class PaymentMethod extends BasePaymentMethod implements PaymentMethodInterface { - /** - * @var Collection|BaseChannelInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $channels; /** @var GatewayConfigInterface|null */ diff --git a/src/Sylius/Component/Core/Model/Product.php b/src/Sylius/Component/Core/Model/Product.php index 4964526bf75..0b500265217 100644 --- a/src/Sylius/Component/Core/Model/Product.php +++ b/src/Sylius/Component/Core/Model/Product.php @@ -27,38 +27,22 @@ class Product extends BaseProduct implements ProductInterface, ReviewableProduct /** @var string|null */ protected $variantSelectionMethod = self::VARIANT_SELECTION_CHOICE; - /** - * @var Collection|ProductTaxonInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $productTaxons; - /** - * @var Collection|ChannelInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $channels; - /** @var \Sylius\Component\Core\Model\TaxonInterface|null */ + /** @var TaxonInterface|null */ protected $mainTaxon; - /** - * @var Collection|ReviewInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $reviews; /** @var float */ protected $averageRating = 0.0; - /** - * @var Collection|ImageInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $images; public function __construct() @@ -143,10 +127,6 @@ public function hasTaxon(TaxonInterface $taxon): bool return $this->getTaxons()->contains($taxon); } - /** - * @psalm-suppress InvalidReturnType https://github.com/doctrine/collections/pull/220 - * @psalm-suppress InvalidReturnStatement https://github.com/doctrine/collections/pull/220 - */ public function getChannels(): Collection { /** @phpstan-ignore-next-line */ diff --git a/src/Sylius/Component/Core/Model/ProductImage.php b/src/Sylius/Component/Core/Model/ProductImage.php index e3c5537d614..63f56ec02e4 100644 --- a/src/Sylius/Component/Core/Model/ProductImage.php +++ b/src/Sylius/Component/Core/Model/ProductImage.php @@ -18,11 +18,7 @@ class ProductImage extends Image implements ProductImageInterface { - /** - * @var Collection|ProductVariantInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $productVariants; public function __construct() diff --git a/src/Sylius/Component/Core/Model/ProductImageInterface.php b/src/Sylius/Component/Core/Model/ProductImageInterface.php index ccb2c552b08..63b2bb5fbbc 100644 --- a/src/Sylius/Component/Core/Model/ProductImageInterface.php +++ b/src/Sylius/Component/Core/Model/ProductImageInterface.php @@ -20,9 +20,7 @@ interface ProductImageInterface extends ImageInterface public function hasProductVariants(): bool; /** - * @return Collection|ProductVariantInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getProductVariants(): Collection; diff --git a/src/Sylius/Component/Core/Model/ProductImagesAwareInterface.php b/src/Sylius/Component/Core/Model/ProductImagesAwareInterface.php index ad35fd4c9cf..6f7935353f8 100644 --- a/src/Sylius/Component/Core/Model/ProductImagesAwareInterface.php +++ b/src/Sylius/Component/Core/Model/ProductImagesAwareInterface.php @@ -18,16 +18,12 @@ interface ProductImagesAwareInterface { /** - * @return Collection|ImageInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getImages(): Collection; /** - * @return Collection|ImageInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getImagesByType(string $type): Collection; diff --git a/src/Sylius/Component/Core/Model/ProductInterface.php b/src/Sylius/Component/Core/Model/ProductInterface.php index 40af7d60214..13b1a571a37 100644 --- a/src/Sylius/Component/Core/Model/ProductInterface.php +++ b/src/Sylius/Component/Core/Model/ProductInterface.php @@ -59,9 +59,7 @@ public function getMainTaxon(): ?TaxonInterface; public function setMainTaxon(?TaxonInterface $mainTaxon): void; /** - * @return Collection|ReviewInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getAcceptedReviews(): Collection; diff --git a/src/Sylius/Component/Core/Model/ProductTaxonsAwareInterface.php b/src/Sylius/Component/Core/Model/ProductTaxonsAwareInterface.php index ca50df6062a..4f976728dc8 100644 --- a/src/Sylius/Component/Core/Model/ProductTaxonsAwareInterface.php +++ b/src/Sylius/Component/Core/Model/ProductTaxonsAwareInterface.php @@ -18,9 +18,7 @@ interface ProductTaxonsAwareInterface { /** - * @return Collection|ProductTaxonInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getProductTaxons(): Collection; @@ -31,9 +29,7 @@ public function addProductTaxon(ProductTaxonInterface $productTaxon): void; public function removeProductTaxon(ProductTaxonInterface $productTaxon): void; /** - * @return Collection|TaxonInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getTaxons(): Collection; diff --git a/src/Sylius/Component/Core/Model/ProductVariant.php b/src/Sylius/Component/Core/Model/ProductVariant.php index f4108ff296a..7430387024b 100644 --- a/src/Sylius/Component/Core/Model/ProductVariant.php +++ b/src/Sylius/Component/Core/Model/ProductVariant.php @@ -59,11 +59,7 @@ class ProductVariant extends BaseVariant implements ProductVariantInterface, Com /** @var bool */ protected $shippingRequired = true; - /** - * @var Collection|ProductImageInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $images; public function __construct() @@ -286,20 +282,12 @@ public function getAppliedPromotionsForChannel(ChannelInterface $channel): Colle return ($channelPricing !== null) ? $channelPricing->getAppliedPromotions() : new ArrayCollection(); } - /** - * @psalm-suppress InvalidReturnType https://github.com/doctrine/collections/pull/220 - * @psalm-suppress InvalidReturnStatement https://github.com/doctrine/collections/pull/220 - */ public function getImages(): Collection { /** @phpstan-ignore-next-line */ return $this->images; } - /** - * @psalm-suppress InvalidReturnType https://github.com/doctrine/collections/pull/220 - * @psalm-suppress InvalidReturnStatement https://github.com/doctrine/collections/pull/220 - */ public function getImagesByType(string $type): Collection { /** @var Collection $imagesByType */ diff --git a/src/Sylius/Component/Core/Model/ProductVariantInterface.php b/src/Sylius/Component/Core/Model/ProductVariantInterface.php index 5da6b4bde08..058d8a369c8 100644 --- a/src/Sylius/Component/Core/Model/ProductVariantInterface.php +++ b/src/Sylius/Component/Core/Model/ProductVariantInterface.php @@ -51,9 +51,7 @@ public function setTaxCategory(?TaxCategoryInterface $category): void; public function setShippingCategory(?ShippingCategoryInterface $shippingCategory): void; /** - * @return Collection|ChannelPricingInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getChannelPricings(): Collection; diff --git a/src/Sylius/Component/Core/Model/Promotion.php b/src/Sylius/Component/Core/Model/Promotion.php index 8bfcd538f17..ee56cf4a828 100644 --- a/src/Sylius/Component/Core/Model/Promotion.php +++ b/src/Sylius/Component/Core/Model/Promotion.php @@ -21,11 +21,7 @@ class Promotion extends BasePromotion implements PromotionInterface { - /** - * @var Collection|ChannelInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $channels; public function __construct() @@ -36,10 +32,6 @@ public function __construct() $this->channels = new ArrayCollection(); } - /** - * @psalm-suppress InvalidReturnType https://github.com/doctrine/collections/pull/220 - * @psalm-suppress InvalidReturnStatement https://github.com/doctrine/collections/pull/220 - */ public function getChannels(): Collection { /** @phpstan-ignore-next-line */ diff --git a/src/Sylius/Component/Core/Model/Shipment.php b/src/Sylius/Component/Core/Model/Shipment.php index 26fdea02223..9eff3c4ff72 100644 --- a/src/Sylius/Component/Core/Model/Shipment.php +++ b/src/Sylius/Component/Core/Model/Shipment.php @@ -26,11 +26,7 @@ class Shipment extends BaseShipment implements ShipmentInterface /** @var BaseOrderInterface|null */ protected $order; - /** - * @var Collection|BaseAdjustmentInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $adjustments; /** @var int */ diff --git a/src/Sylius/Component/Core/Model/ShippingMethod.php b/src/Sylius/Component/Core/Model/ShippingMethod.php index 6e9ccc8db79..222592aacec 100644 --- a/src/Sylius/Component/Core/Model/ShippingMethod.php +++ b/src/Sylius/Component/Core/Model/ShippingMethod.php @@ -30,11 +30,7 @@ class ShippingMethod extends BaseShippingMethod implements ShippingMethodInterfa /** @var TaxCategoryInterface|null */ protected $taxCategory; - /** - * @var Collection|ChannelInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $channels; public function __construct() @@ -65,10 +61,6 @@ public function setTaxCategory(?TaxCategoryInterface $category): void $this->taxCategory = $category; } - /** - * @psalm-suppress InvalidReturnType https://github.com/doctrine/collections/pull/220 - * @psalm-suppress InvalidReturnStatement https://github.com/doctrine/collections/pull/220 - */ public function getChannels(): Collection { /** @phpstan-ignore-next-line */ diff --git a/src/Sylius/Component/Core/Model/Taxon.php b/src/Sylius/Component/Core/Model/Taxon.php index 07e3751dd9d..98d458d46cf 100644 --- a/src/Sylius/Component/Core/Model/Taxon.php +++ b/src/Sylius/Component/Core/Model/Taxon.php @@ -24,11 +24,7 @@ class Taxon extends BaseTaxon implements TaxonInterface, Comparable { use TimestampableTrait; - /** - * @var Collection|ImageInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $images; public function __construct() diff --git a/src/Sylius/Component/Core/StateResolver/OrderPaymentStateResolver.php b/src/Sylius/Component/Core/StateResolver/OrderPaymentStateResolver.php index 4fe86ccd5ba..6b6e3b7c07f 100644 --- a/src/Sylius/Component/Core/StateResolver/OrderPaymentStateResolver.php +++ b/src/Sylius/Component/Core/StateResolver/OrderPaymentStateResolver.php @@ -116,9 +116,7 @@ private function getTargetTransition(OrderInterface $order): ?string } /** - * @return Collection|PaymentInterface[] - * - * @psalm-return Collection + * @return Collection */ private function getPaymentsWithState(OrderInterface $order, string $state): Collection { diff --git a/src/Sylius/Component/Core/Taxation/Applicator/OrderItemUnitsTaxesApplicator.php b/src/Sylius/Component/Core/Taxation/Applicator/OrderItemUnitsTaxesApplicator.php index ad07448bed5..3a2b0dec688 100644 --- a/src/Sylius/Component/Core/Taxation/Applicator/OrderItemUnitsTaxesApplicator.php +++ b/src/Sylius/Component/Core/Taxation/Applicator/OrderItemUnitsTaxesApplicator.php @@ -61,6 +61,7 @@ public function apply(OrderInterface $order, ZoneInterface $zone): void $unitTotalTaxWholeAmount = (int) round(array_sum($unitTaxFloatAmounts)); $unitSplitTaxes = $this->proportionalIntegerDistributor->distribute($unitTaxWholeAmounts, $unitTotalTaxWholeAmount); + /** @var OrderItemUnitInterface $unit */ foreach ($units as $index => $unit) { if (0 === $unitSplitTaxes[$index] || !isset($unitTaxRates[$index])) { continue; diff --git a/src/Sylius/Component/Core/Uploader/ImageUploader.php b/src/Sylius/Component/Core/Uploader/ImageUploader.php index 8fd976a6078..42756921397 100644 --- a/src/Sylius/Component/Core/Uploader/ImageUploader.php +++ b/src/Sylius/Component/Core/Uploader/ImageUploader.php @@ -44,7 +44,6 @@ public function __construct( self::class, ), \E_USER_DEPRECATED); - /** @psalm-suppress DeprecatedClass */ $this->filesystem = new GaufretteFilesystemAdapter($this->filesystem); } diff --git a/src/Sylius/Component/Currency/Context/CompositeCurrencyContext.php b/src/Sylius/Component/Currency/Context/CompositeCurrencyContext.php index be0255151d5..d78cb53b250 100644 --- a/src/Sylius/Component/Currency/Context/CompositeCurrencyContext.php +++ b/src/Sylius/Component/Currency/Context/CompositeCurrencyContext.php @@ -17,11 +17,7 @@ final class CompositeCurrencyContext implements CurrencyContextInterface { - /** - * @var PriorityQueue|CurrencyContextInterface[] - * - * @psalm-var PriorityQueue - */ + /** @var PriorityQueue */ private PriorityQueue $currencyContexts; public function __construct() diff --git a/src/Sylius/Component/Currency/Model/CurrenciesAwareInterface.php b/src/Sylius/Component/Currency/Model/CurrenciesAwareInterface.php index 94547f2fe2e..64f5f49d2db 100644 --- a/src/Sylius/Component/Currency/Model/CurrenciesAwareInterface.php +++ b/src/Sylius/Component/Currency/Model/CurrenciesAwareInterface.php @@ -18,9 +18,7 @@ interface CurrenciesAwareInterface { /** - * @return Collection|CurrencyInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getCurrencies(): Collection; diff --git a/src/Sylius/Component/Currency/Model/ExchangeRate.php b/src/Sylius/Component/Currency/Model/ExchangeRate.php index 5d3254bc4e2..06af2d6de6d 100644 --- a/src/Sylius/Component/Currency/Model/ExchangeRate.php +++ b/src/Sylius/Component/Currency/Model/ExchangeRate.php @@ -41,10 +41,6 @@ public function getId() return $this->id; } - /** - * @psalm-suppress TypeDoesNotContainType - * @psalm-suppress RedundantCondition - */ public function getRatio(): ?float { /** diff --git a/src/Sylius/Component/Locale/Context/CompositeLocaleContext.php b/src/Sylius/Component/Locale/Context/CompositeLocaleContext.php index d3f0d208e96..e3225ea33b9 100644 --- a/src/Sylius/Component/Locale/Context/CompositeLocaleContext.php +++ b/src/Sylius/Component/Locale/Context/CompositeLocaleContext.php @@ -17,11 +17,7 @@ final class CompositeLocaleContext implements LocaleContextInterface { - /** - * @var PriorityQueue|LocaleContextInterface[] - * - * @psalm-var PriorityQueue - */ + /** @var PriorityQueue */ private PriorityQueue $localeContexts; public function __construct() diff --git a/src/Sylius/Component/Locale/Model/LocalesAwareInterface.php b/src/Sylius/Component/Locale/Model/LocalesAwareInterface.php index 9ee070e5e46..e22a1f43f12 100644 --- a/src/Sylius/Component/Locale/Model/LocalesAwareInterface.php +++ b/src/Sylius/Component/Locale/Model/LocalesAwareInterface.php @@ -18,9 +18,7 @@ interface LocalesAwareInterface { /** - * @return Collection|LocaleInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getLocales(): Collection; diff --git a/src/Sylius/Component/Order/Context/CompositeCartContext.php b/src/Sylius/Component/Order/Context/CompositeCartContext.php index fca421a47d0..d8b012d9352 100644 --- a/src/Sylius/Component/Order/Context/CompositeCartContext.php +++ b/src/Sylius/Component/Order/Context/CompositeCartContext.php @@ -18,11 +18,7 @@ final class CompositeCartContext implements CartContextInterface { - /** - * @var PriorityQueue|CartContextInterface[] - * - * @psalm-var PriorityQueue - */ + /** @var PriorityQueue */ private PriorityQueue $cartContexts; public function __construct() diff --git a/src/Sylius/Component/Order/Factory/OrderItemUnitFactory.php b/src/Sylius/Component/Order/Factory/OrderItemUnitFactory.php index 637cbcc72cc..10c2fedf93b 100644 --- a/src/Sylius/Component/Order/Factory/OrderItemUnitFactory.php +++ b/src/Sylius/Component/Order/Factory/OrderItemUnitFactory.php @@ -20,7 +20,7 @@ class OrderItemUnitFactory implements OrderItemUnitFactoryInterface { /** - * @psalm-param class-string $className + * @param class-string $className */ public function __construct(private string $className) { diff --git a/src/Sylius/Component/Order/Model/AdjustableInterface.php b/src/Sylius/Component/Order/Model/AdjustableInterface.php index 1b2498f0b36..11c5a214a10 100644 --- a/src/Sylius/Component/Order/Model/AdjustableInterface.php +++ b/src/Sylius/Component/Order/Model/AdjustableInterface.php @@ -18,9 +18,7 @@ interface AdjustableInterface { /** - * @return Collection|AdjustmentInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getAdjustments(?string $type = null): Collection; diff --git a/src/Sylius/Component/Order/Model/Order.php b/src/Sylius/Component/Order/Model/Order.php index 0630af06bca..f37c2846cc1 100644 --- a/src/Sylius/Component/Order/Model/Order.php +++ b/src/Sylius/Component/Order/Model/Order.php @@ -33,21 +33,13 @@ class Order implements OrderInterface /** @var string|null */ protected $notes; - /** - * @var Collection|OrderItemInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $items; /** @var int */ protected $itemsTotal = 0; - /** - * @var Collection|AdjustmentInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $adjustments; /** @var int */ diff --git a/src/Sylius/Component/Order/Model/OrderInterface.php b/src/Sylius/Component/Order/Model/OrderInterface.php index 27c593f2b53..22e4109cd46 100644 --- a/src/Sylius/Component/Order/Model/OrderInterface.php +++ b/src/Sylius/Component/Order/Model/OrderInterface.php @@ -44,9 +44,7 @@ public function getNotes(): ?string; public function setNotes(?string $notes): void; /** - * @return Collection|OrderItemInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getItems(): Collection; @@ -75,9 +73,7 @@ public function setState(string $state): void; public function isEmpty(): bool; /** - * @return Collection|AdjustmentInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getAdjustmentsRecursively(?string $type = null): Collection; diff --git a/src/Sylius/Component/Order/Model/OrderItem.php b/src/Sylius/Component/Order/Model/OrderItem.php index 28a00e21b0d..01cdc0d7aa0 100644 --- a/src/Sylius/Component/Order/Model/OrderItem.php +++ b/src/Sylius/Component/Order/Model/OrderItem.php @@ -38,21 +38,13 @@ class OrderItem implements OrderItemInterface /** @var bool */ protected $immutable = false; - /** - * @var Collection|OrderItemUnitInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $units; /** @var int */ protected $unitsTotal = 0; - /** - * @var Collection|AdjustmentInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $adjustments; /** @var int */ diff --git a/src/Sylius/Component/Order/Model/OrderItemInterface.php b/src/Sylius/Component/Order/Model/OrderItemInterface.php index 51652ff87a6..97fc691b673 100644 --- a/src/Sylius/Component/Order/Model/OrderItemInterface.php +++ b/src/Sylius/Component/Order/Model/OrderItemInterface.php @@ -46,9 +46,7 @@ public function isImmutable(): bool; public function setImmutable(bool $immutable): void; /** - * @return Collection|OrderItemUnitInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getUnits(): Collection; @@ -59,9 +57,7 @@ public function addUnit(OrderItemUnitInterface $itemUnit): void; public function removeUnit(OrderItemUnitInterface $itemUnit): void; /** - * @return Collection|AdjustmentInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getAdjustmentsRecursively(?string $type = null): Collection; diff --git a/src/Sylius/Component/Order/Model/OrderItemUnit.php b/src/Sylius/Component/Order/Model/OrderItemUnit.php index dde4f2b8b58..179b3b8177e 100644 --- a/src/Sylius/Component/Order/Model/OrderItemUnit.php +++ b/src/Sylius/Component/Order/Model/OrderItemUnit.php @@ -21,11 +21,7 @@ class OrderItemUnit implements OrderItemUnitInterface /** @var mixed */ protected $id; - /** - * @var Collection|AdjustmentInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $adjustments; /** @var int */ diff --git a/src/Sylius/Component/Order/Processor/CompositeOrderProcessor.php b/src/Sylius/Component/Order/Processor/CompositeOrderProcessor.php index d23e3597955..3826d5aed8e 100644 --- a/src/Sylius/Component/Order/Processor/CompositeOrderProcessor.php +++ b/src/Sylius/Component/Order/Processor/CompositeOrderProcessor.php @@ -18,11 +18,7 @@ final class CompositeOrderProcessor implements OrderProcessorInterface { - /** - * @var PriorityQueue|OrderProcessorInterface[] - * - * @psalm-var PriorityQueue - */ + /** @var PriorityQueue */ private PriorityQueue $orderProcessors; public function __construct() diff --git a/src/Sylius/Component/Payment/Model/PaymentsSubjectInterface.php b/src/Sylius/Component/Payment/Model/PaymentsSubjectInterface.php index a21c3484740..8d57da9d0d2 100644 --- a/src/Sylius/Component/Payment/Model/PaymentsSubjectInterface.php +++ b/src/Sylius/Component/Payment/Model/PaymentsSubjectInterface.php @@ -18,9 +18,7 @@ interface PaymentsSubjectInterface { /** - * @return Collection|PaymentInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getPayments(): Collection; diff --git a/src/Sylius/Component/Product/Factory/ProductFactoryInterface.php b/src/Sylius/Component/Product/Factory/ProductFactoryInterface.php index 0bd75795487..ba4d6095131 100644 --- a/src/Sylius/Component/Product/Factory/ProductFactoryInterface.php +++ b/src/Sylius/Component/Product/Factory/ProductFactoryInterface.php @@ -16,6 +16,9 @@ use Sylius\Component\Product\Model\ProductInterface; use Sylius\Component\Resource\Factory\TranslatableFactoryInterface; +/** + * @extends TranslatableFactoryInterface + */ interface ProductFactoryInterface extends TranslatableFactoryInterface { public function createWithVariant(): ProductInterface; diff --git a/src/Sylius/Component/Product/Model/Product.php b/src/Sylius/Component/Product/Model/Product.php index daf55c4db99..41f9d2c77de 100644 --- a/src/Sylius/Component/Product/Model/Product.php +++ b/src/Sylius/Component/Product/Model/Product.php @@ -36,32 +36,16 @@ class Product implements ProductInterface, \Stringable /** @var string|null */ protected $code; - /** - * @var Collection|AttributeValueInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $attributes; - /** - * @var Collection|ProductVariantInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $variants; - /** - * @var Collection|ProductOptionInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $options; - /** - * @var Collection|ProductAssociationInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $associations; public function __construct() diff --git a/src/Sylius/Component/Product/Model/ProductAssociation.php b/src/Sylius/Component/Product/Model/ProductAssociation.php index 70f216de0e8..78212444321 100644 --- a/src/Sylius/Component/Product/Model/ProductAssociation.php +++ b/src/Sylius/Component/Product/Model/ProductAssociation.php @@ -30,11 +30,7 @@ class ProductAssociation implements ProductAssociationInterface /** @var ProductInterface|null */ protected $owner; - /** - * @var Collection|ProductInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $associatedProducts; public function __construct() diff --git a/src/Sylius/Component/Product/Model/ProductAssociationInterface.php b/src/Sylius/Component/Product/Model/ProductAssociationInterface.php index 7d085829b6f..962cfcc588b 100644 --- a/src/Sylius/Component/Product/Model/ProductAssociationInterface.php +++ b/src/Sylius/Component/Product/Model/ProductAssociationInterface.php @@ -28,9 +28,7 @@ public function getOwner(): ?ProductInterface; public function setOwner(?ProductInterface $owner): void; /** - * @return Collection|ProductInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getAssociatedProducts(): Collection; diff --git a/src/Sylius/Component/Product/Model/ProductInterface.php b/src/Sylius/Component/Product/Model/ProductInterface.php index ac1dfad77be..61d9e912feb 100644 --- a/src/Sylius/Component/Product/Model/ProductInterface.php +++ b/src/Sylius/Component/Product/Model/ProductInterface.php @@ -53,9 +53,7 @@ public function setMetaDescription(?string $metaDescription): void; public function hasVariants(): bool; /** - * @return Collection|ProductVariantInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getVariants(): Collection; @@ -66,18 +64,14 @@ public function removeVariant(ProductVariantInterface $variant): void; public function hasVariant(ProductVariantInterface $variant): bool; /** - * @return Collection|ProductVariantInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getEnabledVariants(): Collection; public function hasOptions(): bool; /** - * @return Collection|ProductOptionInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getOptions(): Collection; @@ -88,9 +82,7 @@ public function removeOption(ProductOptionInterface $option): void; public function hasOption(ProductOptionInterface $option): bool; /** - * @return Collection|ProductAssociationInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getAssociations(): Collection; diff --git a/src/Sylius/Component/Product/Model/ProductOption.php b/src/Sylius/Component/Product/Model/ProductOption.php index 15df772ade6..51a77480175 100644 --- a/src/Sylius/Component/Product/Model/ProductOption.php +++ b/src/Sylius/Component/Product/Model/ProductOption.php @@ -36,11 +36,7 @@ class ProductOption implements ProductOptionInterface, \Stringable /** @var int|null */ protected $position; - /** - * @var Collection|ProductOptionValueInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $values; public function __construct() diff --git a/src/Sylius/Component/Product/Model/ProductOptionInterface.php b/src/Sylius/Component/Product/Model/ProductOptionInterface.php index 52dc406becc..beb74817ee0 100644 --- a/src/Sylius/Component/Product/Model/ProductOptionInterface.php +++ b/src/Sylius/Component/Product/Model/ProductOptionInterface.php @@ -47,9 +47,7 @@ public function getPosition(): ?int; public function setPosition(?int $position): void; /** - * @return Collection|ProductOptionValueInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getValues(): Collection; diff --git a/src/Sylius/Component/Product/Model/ProductVariant.php b/src/Sylius/Component/Product/Model/ProductVariant.php index 4d012a0fa61..7f851be8f09 100644 --- a/src/Sylius/Component/Product/Model/ProductVariant.php +++ b/src/Sylius/Component/Product/Model/ProductVariant.php @@ -37,11 +37,7 @@ class ProductVariant implements ProductVariantInterface /** @var ProductInterface|null */ protected $product; - /** - * @var Collection|ProductOptionValueInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $optionValues; /** @var int|null */ diff --git a/src/Sylius/Component/Product/Model/ProductVariantInterface.php b/src/Sylius/Component/Product/Model/ProductVariantInterface.php index 1779bdc8d42..3e674ccaa35 100644 --- a/src/Sylius/Component/Product/Model/ProductVariantInterface.php +++ b/src/Sylius/Component/Product/Model/ProductVariantInterface.php @@ -35,9 +35,7 @@ public function setName(?string $name): void; public function getDescriptor(): string; /** - * @return Collection|ProductOptionValueInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getOptionValues(): Collection; diff --git a/src/Sylius/Component/Product/Resolver/AvailableProductOptionValuesResolverInterface.php b/src/Sylius/Component/Product/Resolver/AvailableProductOptionValuesResolverInterface.php index aff1a344fd2..4f70818c375 100644 --- a/src/Sylius/Component/Product/Resolver/AvailableProductOptionValuesResolverInterface.php +++ b/src/Sylius/Component/Product/Resolver/AvailableProductOptionValuesResolverInterface.php @@ -21,9 +21,7 @@ interface AvailableProductOptionValuesResolverInterface { /** - * @return Collection|ProductOptionValueInterface[] - * - * @psalm-return Collection + * @return Collection */ public function resolve(ProductInterface $product, ProductOptionInterface $productOption): Collection; } diff --git a/src/Sylius/Component/Promotion/Model/CatalogPromotion.php b/src/Sylius/Component/Promotion/Model/CatalogPromotion.php index 2c8a3a039c6..0d65e647130 100644 --- a/src/Sylius/Component/Promotion/Model/CatalogPromotion.php +++ b/src/Sylius/Component/Promotion/Model/CatalogPromotion.php @@ -42,13 +42,10 @@ class CatalogPromotion implements CatalogPromotionInterface protected string $state = CatalogPromotionStates::STATE_INACTIVE; - /** - * @var Collection|CatalogPromotionScopeInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected Collection $scopes; + /** @var Collection */ protected Collection $actions; protected ?bool $enabled = true; diff --git a/src/Sylius/Component/Promotion/Model/CatalogPromotionInterface.php b/src/Sylius/Component/Promotion/Model/CatalogPromotionInterface.php index 0194af821a0..92581cd0f46 100644 --- a/src/Sylius/Component/Promotion/Model/CatalogPromotionInterface.php +++ b/src/Sylius/Component/Promotion/Model/CatalogPromotionInterface.php @@ -58,9 +58,7 @@ public function setDescription(?string $description): void; public function getTranslation(?string $locale = null): TranslationInterface; /** - * @return Collection|CatalogPromotionScopeInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getScopes(): Collection; @@ -71,9 +69,7 @@ public function addScope(CatalogPromotionScopeInterface $scope): void; public function removeScope(CatalogPromotionScopeInterface $scope): void; /** - * @return Collection|CatalogPromotionActionInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getActions(): Collection; diff --git a/src/Sylius/Component/Promotion/Model/Promotion.php b/src/Sylius/Component/Promotion/Model/Promotion.php index 6656335c985..2ef4ae1fd6d 100644 --- a/src/Sylius/Component/Promotion/Model/Promotion.php +++ b/src/Sylius/Component/Promotion/Model/Promotion.php @@ -62,25 +62,13 @@ class Promotion implements PromotionInterface /** @var bool */ protected $couponBased = false; - /** - * @var Collection|PromotionCouponInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $coupons; - /** - * @var Collection|PromotionRuleInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $rules; - /** - * @var Collection|PromotionActionInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $actions; protected bool $appliesToDiscounted = true; diff --git a/src/Sylius/Component/Promotion/Model/PromotionInterface.php b/src/Sylius/Component/Promotion/Model/PromotionInterface.php index d89b11d4c09..aebe45f7d7d 100644 --- a/src/Sylius/Component/Promotion/Model/PromotionInterface.php +++ b/src/Sylius/Component/Promotion/Model/PromotionInterface.php @@ -61,9 +61,7 @@ public function isCouponBased(): bool; public function setCouponBased(?bool $couponBased): void; /** - * @return Collection|PromotionCouponInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getCoupons(): Collection; @@ -76,9 +74,7 @@ public function addCoupon(PromotionCouponInterface $coupon): void; public function removeCoupon(PromotionCouponInterface $coupon): void; /** - * @return Collection|PromotionRuleInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getRules(): Collection; @@ -91,9 +87,7 @@ public function addRule(PromotionRuleInterface $rule): void; public function removeRule(PromotionRuleInterface $rule): void; /** - * @return Collection|PromotionActionInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getActions(): Collection; diff --git a/src/Sylius/Component/Promotion/Model/PromotionSubjectInterface.php b/src/Sylius/Component/Promotion/Model/PromotionSubjectInterface.php index 669f649b377..5a6218e4b03 100644 --- a/src/Sylius/Component/Promotion/Model/PromotionSubjectInterface.php +++ b/src/Sylius/Component/Promotion/Model/PromotionSubjectInterface.php @@ -20,9 +20,7 @@ interface PromotionSubjectInterface public function getPromotionSubjectTotal(): int; /** - * @return Collection|PromotionInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getPromotions(): Collection; diff --git a/src/Sylius/Component/Review/Model/ReviewableInterface.php b/src/Sylius/Component/Review/Model/ReviewableInterface.php index 3c90c3b7dac..8eda37497f3 100644 --- a/src/Sylius/Component/Review/Model/ReviewableInterface.php +++ b/src/Sylius/Component/Review/Model/ReviewableInterface.php @@ -23,9 +23,7 @@ interface ReviewableInterface public function getName(): ?string; /** - * @return Collection|ReviewInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getReviews(): Collection; diff --git a/src/Sylius/Component/Shipping/Checker/ShippingMethodEligibilityChecker.php b/src/Sylius/Component/Shipping/Checker/ShippingMethodEligibilityChecker.php index 6776920fe91..04559ae6ea7 100644 --- a/src/Sylius/Component/Shipping/Checker/ShippingMethodEligibilityChecker.php +++ b/src/Sylius/Component/Shipping/Checker/ShippingMethodEligibilityChecker.php @@ -13,16 +13,13 @@ namespace Sylius\Component\Shipping\Checker; -use const E_USER_DEPRECATED; use Sylius\Component\Shipping\Model\ShippingMethodInterface; use Sylius\Component\Shipping\Model\ShippingSubjectInterface; -@trigger_error(sprintf('The "%s" class is deprecated since Sylius 1.8, use "%s" instead.', 'Sylius\Component\Shipping\Checker\ShippingMethodEligibilityChecker', 'Sylius\Component\Shipping\Checker\Eligibility\CompositeShippingMethodEligibilityChecker'), E_USER_DEPRECATED); +@trigger_error(sprintf('The "%s" class is deprecated since Sylius 1.8, use "%s" instead.', 'Sylius\Component\Shipping\Checker\ShippingMethodEligibilityChecker', 'Sylius\Component\Shipping\Checker\Eligibility\CompositeShippingMethodEligibilityChecker'), \E_USER_DEPRECATED); /** * @deprecated since Sylius 1.8. Use Sylius\Component\Shipping\Checker\Eligibility\CompositeShippingMethodEligibilityChecker instead - * - * @psalm-suppress DeprecatedInterface */ final class ShippingMethodEligibilityChecker implements ShippingMethodEligibilityCheckerInterface { diff --git a/src/Sylius/Component/Shipping/Model/Shipment.php b/src/Sylius/Component/Shipping/Model/Shipment.php index f9dce2d184f..9ae45bb531c 100644 --- a/src/Sylius/Component/Shipping/Model/Shipment.php +++ b/src/Sylius/Component/Shipping/Model/Shipment.php @@ -30,11 +30,7 @@ class Shipment implements ShipmentInterface, \Stringable /** @var ShippingMethodInterface|null */ protected $method; - /** - * @var Collection|ShipmentUnitInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $units; /** @var string|null */ diff --git a/src/Sylius/Component/Shipping/Model/ShipmentInterface.php b/src/Sylius/Component/Shipping/Model/ShipmentInterface.php index 15537ee95cf..32252ac510e 100644 --- a/src/Sylius/Component/Shipping/Model/ShipmentInterface.php +++ b/src/Sylius/Component/Shipping/Model/ShipmentInterface.php @@ -36,9 +36,7 @@ public function getMethod(): ?ShippingMethodInterface; public function setMethod(?ShippingMethodInterface $method): void; /** - * @return Collection|ShipmentUnitInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getUnits(): Collection; diff --git a/src/Sylius/Component/Shipping/Model/ShippingMethod.php b/src/Sylius/Component/Shipping/Model/ShippingMethod.php index d8f1cf4b9a7..d5901bd0b31 100644 --- a/src/Sylius/Component/Shipping/Model/ShippingMethod.php +++ b/src/Sylius/Component/Shipping/Model/ShippingMethod.php @@ -50,11 +50,7 @@ class ShippingMethod implements ShippingMethodInterface, \Stringable /** @var mixed[] */ protected $configuration = []; - /** - * @var Collection|ShippingMethodRuleInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $rules; public function __construct() diff --git a/src/Sylius/Component/Shipping/Model/ShippingMethodInterface.php b/src/Sylius/Component/Shipping/Model/ShippingMethodInterface.php index 5f743d5f412..f390725d5bb 100644 --- a/src/Sylius/Component/Shipping/Model/ShippingMethodInterface.php +++ b/src/Sylius/Component/Shipping/Model/ShippingMethodInterface.php @@ -79,9 +79,7 @@ public function getConfiguration(): array; public function setConfiguration(array $configuration): void; /** - * @return Collection|ShippingMethodRuleInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getRules(): Collection; diff --git a/src/Sylius/Component/Shipping/Model/ShippingMethodRule.php b/src/Sylius/Component/Shipping/Model/ShippingMethodRule.php index 7c0e6b59a1f..f27aa2b2320 100644 --- a/src/Sylius/Component/Shipping/Model/ShippingMethodRule.php +++ b/src/Sylius/Component/Shipping/Model/ShippingMethodRule.php @@ -13,9 +13,6 @@ namespace Sylius\Component\Shipping\Model; -/** - * @psalm-suppress MissingConstructor - */ class ShippingMethodRule implements ShippingMethodRuleInterface { /** @var mixed */ diff --git a/src/Sylius/Component/Shipping/Model/ShippingSubjectInterface.php b/src/Sylius/Component/Shipping/Model/ShippingSubjectInterface.php index 892a9998b19..6f05ba6c331 100644 --- a/src/Sylius/Component/Shipping/Model/ShippingSubjectInterface.php +++ b/src/Sylius/Component/Shipping/Model/ShippingSubjectInterface.php @@ -26,9 +26,7 @@ public function getShippingUnitCount(): int; public function getShippingUnitTotal(): int; /** - * @return Collection|ShippableInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getShippables(): Collection; } diff --git a/src/Sylius/Component/Taxation/Model/TaxCategory.php b/src/Sylius/Component/Taxation/Model/TaxCategory.php index 1ae1a13d956..34c4460fa0c 100644 --- a/src/Sylius/Component/Taxation/Model/TaxCategory.php +++ b/src/Sylius/Component/Taxation/Model/TaxCategory.php @@ -33,11 +33,7 @@ class TaxCategory implements TaxCategoryInterface, \Stringable /** @var string|null */ protected $description; - /** - * @var Collection|TaxRateInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $rates; public function __construct() diff --git a/src/Sylius/Component/Taxation/Model/TaxCategoryInterface.php b/src/Sylius/Component/Taxation/Model/TaxCategoryInterface.php index 1bb8a6011fb..3cd17eb4a60 100644 --- a/src/Sylius/Component/Taxation/Model/TaxCategoryInterface.php +++ b/src/Sylius/Component/Taxation/Model/TaxCategoryInterface.php @@ -29,9 +29,7 @@ public function getDescription(): ?string; public function setDescription(?string $description): void; /** - * @return Collection|TaxRateInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getRates(): Collection; diff --git a/src/Sylius/Component/Taxation/Model/TaxRate.php b/src/Sylius/Component/Taxation/Model/TaxRate.php index 442bda6491f..199a1fb0746 100644 --- a/src/Sylius/Component/Taxation/Model/TaxRate.php +++ b/src/Sylius/Component/Taxation/Model/TaxRate.php @@ -84,7 +84,6 @@ public function setName(?string $name): void $this->name = $name; } - /** @psalm-suppress RedundantCastGivenDocblockType */ public function getAmount(): float { return (float) $this->amount; diff --git a/src/Sylius/Component/Taxonomy/Model/Taxon.php b/src/Sylius/Component/Taxonomy/Model/Taxon.php index a7a61fb0085..3644e82d16c 100644 --- a/src/Sylius/Component/Taxonomy/Model/Taxon.php +++ b/src/Sylius/Component/Taxonomy/Model/Taxon.php @@ -39,11 +39,7 @@ class Taxon implements TaxonInterface, \Stringable /** @var TaxonInterface|null */ protected $parent; - /** - * @var Collection|TaxonInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $children; /** @var int|null */ diff --git a/src/Sylius/Component/Taxonomy/Model/TaxonInterface.php b/src/Sylius/Component/Taxonomy/Model/TaxonInterface.php index 4fc8d8074d7..0afe18a0e55 100644 --- a/src/Sylius/Component/Taxonomy/Model/TaxonInterface.php +++ b/src/Sylius/Component/Taxonomy/Model/TaxonInterface.php @@ -32,16 +32,12 @@ public function getParent(): ?self; public function setParent(?self $taxon): void; /** - * @return Collection|TaxonInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getAncestors(): Collection; /** - * @return Collection|TaxonInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getChildren(): Collection; @@ -54,9 +50,7 @@ public function addChild(self $taxon): void; public function removeChild(self $taxon): void; /** - * @return Collection|TaxonInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getEnabledChildren(): Collection; diff --git a/src/Sylius/Component/Taxonomy/Model/TaxonsAwareInterface.php b/src/Sylius/Component/Taxonomy/Model/TaxonsAwareInterface.php index a3c077eae18..dff1d610613 100644 --- a/src/Sylius/Component/Taxonomy/Model/TaxonsAwareInterface.php +++ b/src/Sylius/Component/Taxonomy/Model/TaxonsAwareInterface.php @@ -18,9 +18,7 @@ interface TaxonsAwareInterface { /** - * @return Collection|TaxonInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getTaxons(): Collection; diff --git a/src/Sylius/Component/User/Model/User.php b/src/Sylius/Component/User/Model/User.php index fc70bf3b66e..57bb19eeed7 100644 --- a/src/Sylius/Component/User/Model/User.php +++ b/src/Sylius/Component/User/Model/User.php @@ -95,11 +95,7 @@ class User implements UserInterface, \Stringable */ protected $roles = [UserInterface::DEFAULT_ROLE]; - /** - * @var Collection|UserOAuthInterface[] - * - * @psalm-var Collection - */ + /** @var Collection */ protected $oauthAccounts; /** @var string|null */ @@ -124,7 +120,6 @@ public function __construct() $this->enabled = false; } - /** @psalm-suppress RedundantCastGivenDocblockType */ public function __toString(): string { return (string) $this->getUsername(); diff --git a/src/Sylius/Component/User/Model/UserInterface.php b/src/Sylius/Component/User/Model/UserInterface.php index 3d349b1307f..e2c8305facf 100644 --- a/src/Sylius/Component/User/Model/UserInterface.php +++ b/src/Sylius/Component/User/Model/UserInterface.php @@ -102,9 +102,7 @@ public function addRole(string $role): void; public function removeRole(string $role): void; /** - * @return Collection|UserOAuthInterface[] - * - * @psalm-return Collection + * @return Collection */ public function getOAuthAccounts(): Collection; diff --git a/src/Sylius/Component/User/Security/PasswordUpdater.php b/src/Sylius/Component/User/Security/PasswordUpdater.php index 0e5e0417cbc..37cf5209733 100644 --- a/src/Sylius/Component/User/Security/PasswordUpdater.php +++ b/src/Sylius/Component/User/Security/PasswordUpdater.php @@ -17,7 +17,6 @@ final class PasswordUpdater implements PasswordUpdaterInterface { - /** @psalm-suppress DeprecatedClass */ public function __construct(private UserPasswordEncoderInterface|UserPasswordHasherInterface $userPasswordEncoderOrHasher) { if ($this->userPasswordEncoderOrHasher instanceof UserPasswordEncoderInterface) {