diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index e090d2e52..e1211c971 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -65,56 +65,16 @@ parameters: count: 5 path: src/Pos/PosSyncController.php - - - message: "#^Class Swag\\\\PayPal\\\\Pos\\\\Sync\\\\Context\\\\InventoryContext has an uninitialized property \\$salesChannel\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: src/Pos/Sync/Context/InventoryContext.php - - message: "#^Array method calls \\[\\$this, \"method\"\\] are not allowed\\. Use explicit method instead to help PhpStorm, PHPStan and Rector understand your code$#" count: 2 path: src/Pos/Sync/Context/InventoryContextFactory.php - - - message: "#^Class Swag\\\\PayPal\\\\Pos\\\\Sync\\\\Inventory\\\\Calculator\\\\LocalWebhookCalculator has an uninitialized property \\$fixedUpdates\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: src/Pos/Sync/Inventory/Calculator/LocalWebhookCalculator.php - - message: "#^Array method calls \\[\\$this, \"method\"\\] are not allowed\\. Use explicit method instead to help PhpStorm, PHPStan and Rector understand your code$#" count: 1 path: src/Pos/Sync/Product/DeletedUpdater.php - - - message: "#^Class Swag\\\\PayPal\\\\Pos\\\\Sync\\\\Product\\\\Util\\\\ProductGrouping has an uninitialized property \\$product\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: src/Pos/Sync/Product/Util/ProductGrouping.php - - - - message: "#^Access to an uninitialized property Swag\\\\PayPal\\\\Pos\\\\Webhook\\\\WebhookRegistry\\:\\:\\$registeredWebhooks\\.$#" - count: 2 - path: src/Pos/Webhook/WebhookRegistry.php - - - - message: "#^Class Swag\\\\PayPal\\\\Reporting\\\\DataAbstractionLayer\\\\TransactionReport\\\\TransactionReportEntity has an uninitialized property \\$currencyIso\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: src/Reporting/DataAbstractionLayer/TransactionReport/TransactionReportEntity.php - - - - message: "#^Class Swag\\\\PayPal\\\\Reporting\\\\DataAbstractionLayer\\\\TransactionReport\\\\TransactionReportEntity has an uninitialized property \\$orderTransactionId\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: src/Reporting/DataAbstractionLayer/TransactionReport/TransactionReportEntity.php - - - - message: "#^Class Swag\\\\PayPal\\\\Reporting\\\\DataAbstractionLayer\\\\TransactionReport\\\\TransactionReportEntity has an uninitialized property \\$orderTransactionVersionId\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: src/Reporting/DataAbstractionLayer/TransactionReport/TransactionReportEntity.php - - - - message: "#^Class Swag\\\\PayPal\\\\Reporting\\\\DataAbstractionLayer\\\\TransactionReport\\\\TransactionReportEntity has an uninitialized property \\$totalPrice\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: src/Reporting/DataAbstractionLayer/TransactionReport/TransactionReportEntity.php - - message: "#^Use explicit names over dynamic ones$#" count: 7 @@ -130,61 +90,6 @@ parameters: count: 2 path: src/Storefront/Data/CheckoutDataSubscriber.php - - - message: "#^Class Swag\\\\PayPal\\\\Util\\\\Availability\\\\AvailabilityContext has an uninitialized property \\$billingCountryCode\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: src/Util/Availability/AvailabilityContext.php - - - - message: "#^Class Swag\\\\PayPal\\\\Util\\\\Availability\\\\AvailabilityContext has an uninitialized property \\$currencyCode\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: src/Util/Availability/AvailabilityContext.php - - - - message: "#^Class Swag\\\\PayPal\\\\Util\\\\Availability\\\\AvailabilityContext has an uninitialized property \\$hasDigitalProducts\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: src/Util/Availability/AvailabilityContext.php - - - - message: "#^Class Swag\\\\PayPal\\\\Util\\\\Availability\\\\AvailabilityContext has an uninitialized property \\$salesChannelId\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: src/Util/Availability/AvailabilityContext.php - - - - message: "#^Class Swag\\\\PayPal\\\\Util\\\\Availability\\\\AvailabilityContext has an uninitialized property \\$subscription\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: src/Util/Availability/AvailabilityContext.php - - - - message: "#^Class Swag\\\\PayPal\\\\Util\\\\Availability\\\\AvailabilityContext has an uninitialized property \\$totalAmount\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: src/Util/Availability/AvailabilityContext.php - - - - message: "#^Access to an uninitialized property Swag\\\\PayPal\\\\Webhook\\\\WebhookRegistry\\:\\:\\$registeredWebhooks\\.$#" - count: 2 - path: src/Webhook/WebhookRegistry.php - - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\Checkout\\\\Card\\\\AbstractCardValidatorTestCase has an uninitialized property \\$systemConfigService\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/Checkout/Card/AbstractCardValidatorTestCase.php - - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\Checkout\\\\Card\\\\AbstractCardValidatorTestCase has an uninitialized property \\$validator\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/Checkout/Card/AbstractCardValidatorTestCase.php - - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\Checkout\\\\Method\\\\AbstractTestSyncAPMHandler has an uninitialized property \\$clientFactory\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/Checkout/Method/AbstractTestSyncAPMHandler.php - - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\Checkout\\\\Method\\\\PUIHandlerTest has an uninitialized property \\$session\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/Checkout/Method/PUIHandlerTest.php - - message: "#^Mixed variable in a `\\$criteria\\-\\>\\.\\.\\.\\(\\)` can skip important errors\\. Make sure the type is known$#" count: 1 @@ -205,26 +110,11 @@ parameters: count: 1 path: tests/Checkout/Payment/MessageQueue/TransactionStatusSyncMessageHandlerTest.php - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\Checkout\\\\Payment\\\\PayPalPaymentHandlerTest has an uninitialized property \\$clientFactory\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/Checkout/Payment/PayPalPaymentHandlerTest.php - - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\Checkout\\\\Plus\\\\PlusPaymentFinalizeControllerTest has an uninitialized property \\$orderTransactionStateHandler\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/Checkout/Plus/PlusPaymentFinalizeControllerTest.php - - message: "#^Class like namespace \"Swag\\\\PayPal\\\\Test\\\\Installment\\\\Banner\" does not follow PSR\\-4 configuration in composer\\.json$#" count: 1 path: tests/Installment/Banner/Service/BannerDataServiceTest.php - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\Mock\\\\PayPal\\\\Client\\\\GuzzleClientMock has an uninitialized property \\$data\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/Mock/PayPal/Client/GuzzleClientMock.php - - message: "#^Mixed variable in a `\\$struct\\-\\>\\.\\.\\.\\(\\)` can skip important errors\\. Make sure the type is known$#" count: 1 @@ -240,46 +130,6 @@ parameters: count: 2 path: tests/OrdersApi/Builder/APMOrderBuilderTest.php - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\Pos\\\\Api\\\\Common\\\\_fixtures\\\\TestStruct has an uninitialized property \\$bar\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/Pos/Api/Common/_fixtures/TestStruct.php - - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\Pos\\\\Api\\\\Common\\\\_fixtures\\\\TestStruct has an uninitialized property \\$foo\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/Pos/Api/Common/_fixtures/TestStruct.php - - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\Pos\\\\Api\\\\Common\\\\_fixtures\\\\TestStruct has an uninitialized property \\$id\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/Pos/Api/Common/_fixtures/TestStruct.php - - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\Pos\\\\Api\\\\Common\\\\_fixtures\\\\TestStruct has an uninitialized property \\$notExistingClass\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/Pos/Api/Common/_fixtures/TestStruct.php - - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\Pos\\\\Api\\\\Common\\\\_fixtures\\\\TestStruct has an uninitialized property \\$notExistingCollectionClass\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/Pos/Api/Common/_fixtures/TestStruct.php - - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\Pos\\\\Api\\\\Common\\\\_fixtures\\\\TestStruct\\\\Bar has an uninitialized property \\$bar\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/Pos/Api/Common/_fixtures/TestStruct/Bar.php - - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\Pos\\\\Api\\\\Common\\\\_fixtures\\\\TestStruct\\\\Foo has an uninitialized property \\$fooBaz\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/Pos/Api/Common/_fixtures/TestStruct/Foo.php - - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\Pos\\\\Api\\\\Common\\\\_fixtures\\\\TestStruct\\\\Foo has an uninitialized property \\$fooBoo\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/Pos/Api/Common/_fixtures/TestStruct/Foo.php - - message: "#^Provide more specific return type \"GuzzleHttp\\\\Psr7\\\\Response\" over abstract one$#" count: 1 @@ -290,11 +140,6 @@ parameters: count: 1 path: tests/Pos/Mock/MessageBusMock.php - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\Pos\\\\Mock\\\\ProductContextMock has an uninitialized property \\$status\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/Pos/Mock/ProductContextMock.php - - message: "#^Parameter \\#1 \\$entity of method Shopware\\\\Core\\\\Framework\\\\DataAbstractionLayer\\\\EntityCollection\\\\:\\:add\\(\\) expects Shopware\\\\Core\\\\Content\\\\Product\\\\ProductEntity, Shopware\\\\Core\\\\Framework\\\\DataAbstractionLayer\\\\Entity given\\.$#" count: 2 @@ -310,36 +155,6 @@ parameters: count: 2 path: tests/Pos/Run/PosSyncControllerTest.php - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\Pos\\\\Util\\\\SettingsControllerTest has an uninitialized property \\$messageBus\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/Pos/Util/SettingsControllerTest.php - - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\Pos\\\\Util\\\\SettingsControllerTest has an uninitialized property \\$productVisibilityRepository\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/Pos/Util/SettingsControllerTest.php - - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\Pos\\\\Util\\\\SettingsControllerTest has an uninitialized property \\$runRepository\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/Pos/Util/SettingsControllerTest.php - - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\Pos\\\\Util\\\\SettingsControllerTest has an uninitialized property \\$runService\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/Pos/Util/SettingsControllerTest.php - - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\Pos\\\\Util\\\\SettingsControllerTest has an uninitialized property \\$salesChannelProductRepository\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/Pos/Util/SettingsControllerTest.php - - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\Pos\\\\Util\\\\SettingsControllerTest has an uninitialized property \\$salesChannelRepository\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/Pos/Util/SettingsControllerTest.php - - message: "#^Class like namespace \"Swag\\\\PayPal\\\\Test\\\\Pos\\\\Util\" does not follow PSR\\-4 configuration in composer\\.json$#" count: 1 @@ -370,61 +185,6 @@ parameters: count: 2 path: tests/RestApi/PayPalApiStructStructureTest.php - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\RestApi\\\\V1\\\\Resource\\\\WebhookResourceTest has an uninitialized property \\$clientFactory\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/RestApi/V1/Resource/WebhookResourceTest.php - - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\RestApi\\\\_fixtures\\\\TestStruct has an uninitialized property \\$bar\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/RestApi/_fixtures/TestStruct.php - - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\RestApi\\\\_fixtures\\\\TestStruct has an uninitialized property \\$foo\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/RestApi/_fixtures/TestStruct.php - - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\RestApi\\\\_fixtures\\\\TestStruct has an uninitialized property \\$id\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/RestApi/_fixtures/TestStruct.php - - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\RestApi\\\\_fixtures\\\\TestStruct has an uninitialized property \\$notExistingClass\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/RestApi/_fixtures/TestStruct.php - - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\RestApi\\\\_fixtures\\\\TestStruct has an uninitialized property \\$notExistingCollectionClass\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/RestApi/_fixtures/TestStruct.php - - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\RestApi\\\\_fixtures\\\\TestStruct has an uninitialized property \\$scalarArray\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/RestApi/_fixtures/TestStruct.php - - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\RestApi\\\\_fixtures\\\\TestStruct\\\\Bar has an uninitialized property \\$bar\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/RestApi/_fixtures/TestStruct/Bar.php - - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\RestApi\\\\_fixtures\\\\TestStruct\\\\Foo has an uninitialized property \\$fooBaz\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/RestApi/_fixtures/TestStruct/Foo.php - - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\Setting\\\\Service\\\\MerchantIntegrationsServiceTest has an uninitialized property \\$clientFactory\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/Setting/Service/MerchantIntegrationsServiceTest.php - - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\Setting\\\\Service\\\\MerchantIntegrationsServiceTest has an uninitialized property \\$systemConfigService\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/Setting/Service/MerchantIntegrationsServiceTest.php - - message: "#^Class like namespace \"\" does not follow PSR\\-4 configuration in composer\\.json$#" count: 1 @@ -440,11 +200,6 @@ parameters: count: 4 path: tests/Storefront/Data/CheckoutSubscriberTest.php - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\Storefront\\\\Data\\\\FundingSubscriberTest has an uninitialized property \\$session\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/Storefront/Data/FundingSubscriberTest.php - - message: "#^Class like namespace \"Shopware\\\\Core\" does not follow PSR\\-4 configuration in composer\\.json$#" count: 1 @@ -464,13 +219,3 @@ parameters: message: "#^Class like namespace \"Swag\\\\PayPal\\\\Test\\\\Util\\\\Lifecycle\" does not follow PSR\\-4 configuration in composer\\.json$#" count: 1 path: tests/Util/Availability/AvailabilityServiceTest.php - - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\Util\\\\Lifecycle\\\\State\\\\PaymentMethodStateServiceTest has an uninitialized property \\$paymentMethodRepository\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/Util/Lifecycle/State/PaymentMethodStateServiceTest.php - - - - message: "#^Class Swag\\\\PayPal\\\\Test\\\\Webhook\\\\Handler\\\\SaleRefundedTest has an uninitialized property \\$sale\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: tests/Webhook/Handler/SaleRefundedTest.php diff --git a/phpstan.neon.dist b/phpstan.neon.dist index b0d9d9dc3..a463c84f1 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,6 +1,6 @@ includes: - phpstan-baseline.neon - - %ShopwareRoot%/vendor/phpstan/phpstan/conf/bleedingEdge.neon + - phar://phpstan.phar/conf/bleedingEdge.neon - %ShopwareRoot%/src/Core/DevOps/StaticAnalyze/PHPStan/extension.neon - %ShopwareRoot%/src/Core/DevOps/StaticAnalyze/PHPStan/rules.neon @@ -11,7 +11,6 @@ parameters: treatPhpDocTypesAsCertain: false checkFunctionNameCase: true checkInternalClassCaseSensitivity: true - checkUninitializedProperties: true reportUnmatchedIgnoredErrors: true paths: @@ -48,24 +47,6 @@ parameters: - '#.* generic class Shopware\\Core\\System\\SalesChannel\\Entity\\SalesChannelRepository.*not specify its types: TEntityCollection#' - '#.* generic class Shopware\\Core\\Framework\\DataAbstractionLayer\\Search\\EntitySearchResult.*does not specify its types: TEntityCollection#' - - # Ignore uninitialized property in structs - message: '#Class .* has an uninitialized property .* Give it default value or assign it in the constructor#' - paths: - - src/Checkout/ExpressCheckout/ExpressCheckoutButtonData.php - - src/Checkout/PUI/PUIFraudNetData.php - - src/Checkout/PUI/PUIPaymentInstructionData.php - - src/Checkout/Plus/PlusData.php - - src/Checkout/SPBCheckout/SPBCheckoutButtonData.php - - src/DataAbstractionLayer - - src/Installment/Banner/BannerData.php - - src/RestApi - - src/Setting/Struct - - src/Storefront/Data/Struct - - src/Pos/Api - - src/Pos/DataAbstractionLayer/Entity - - src/Pos/MessageQueue/Message - - src/Pos/Setting/Struct - - # This service gets registered within Cms Extensions message: '#is not registered in the container#' path: tests/Checkout/ExpressCheckout/ExpressCheckoutSubscriberTest.php @@ -95,10 +76,6 @@ parameters: - src/Pos/Schedule/AbstractSyncTaskHandler.php - src/Reporting/ScheduledTask/TurnoverReportingTaskHandler.php - - # The RouteScopeRule seems to be broken if extending a controller - message: '#Method Shopware\\Core\\System\\SystemConfig\\Api\\SystemConfigController::.* has no route scope defined. Please add a route scope to the method or the class#' - path: src/Webhook/Registration/WebhookSystemConfigController.php - - # ignore shopware v6.7 payment handlers refactor deprecations message: '#tag:v6.7.0 -.*PaymentTransactionStruct#' paths: @@ -123,8 +100,6 @@ parameters: - # ignore shopware v6.7 payment handlers refactor deprecations message: '#Swag\\PayPal\\Pos\\Payment\\PosPayment#' paths: - - src/Pos/Setting/Service/InformationDefaultService.php - - tests/Checkout/CheckoutSubscriberTest.php - tests/Pos/Util/InformationDefaultServiceTest.php - # ignore shopware v6.7 native type deprecations diff --git a/src/DevOps/Command/GenerateOpenApi.php b/src/DevOps/Command/GenerateOpenApi.php index 4a13bfc23..d3c131632 100644 --- a/src/DevOps/Command/GenerateOpenApi.php +++ b/src/DevOps/Command/GenerateOpenApi.php @@ -44,7 +44,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int ]); if ($openApi === null) { - // @phpstan-ignore-next-line throw new \RuntimeException('Failed to generate OpenAPI schema'); }