Skip to content
Snippets Groups Projects
Commit e8cca221 authored by Alex Pott's avatar Alex Pott Committed by Jonathan Sacksick
Browse files

Issue #3405463 by alexpott: Enable PHPStan.

parent 39c47746
No related branches found
No related tags found
3 merge requests!235Issue #3115150 by mbovan: Submitting add to cart form with empty quantity...,!205Issue #3349465 by tBKoT, jsacksick, bojanz: Update several VAT rates and setup...,!199Enable PHPStan
Pipeline #57891 passed
......@@ -49,7 +49,6 @@ include:
# Docs at https://git.drupalcode.org/project/gitlab_templates/-/blob/1.0.x/includes/include.drupalci.variables.yml
################
variables:
SKIP_PHPSTAN: '1'
_PHPUNIT_CONCURRENT: "1"
_PHPUNIT_EXTRA: --suppress-deprecations
......
......@@ -19,6 +19,8 @@
},
"require-dev": {
"drupal/entity_print": "^2.2",
"drupal/panelizer": "^5.0",
"drupal/physical": "^1.3",
"drupal/mailsystem": "^4.3"
},
"conflict": {
......
parameters:
ignoreErrors:
-
message: "#^\\\\Drupal calls should be avoided in classes, use dependency injection instead$#"
count: 1
path: modules/cart/src/Plugin/Block/CartBlock.php
-
message: "#^@covers value \\\\Drupal\\\\commerce_cart\\\\CartProvider\\:\\:finalizeCart\\(\\) references an invalid method\\.$#"
count: 1
path: modules/cart/tests/src/Kernel/CartOrderPlacedTest.php
-
message: "#^\\\\Drupal calls should be avoided in classes, use dependency injection instead$#"
count: 1
path: modules/checkout/src/CheckoutPaneManager.php
-
message: "#^Method Drupal\\\\commerce_checkout\\\\Entity\\\\CheckoutFlow\\:\\:set\\(\\) should return \\$this\\(Drupal\\\\commerce_checkout\\\\Entity\\\\CheckoutFlow\\) but return statement is missing\\.$#"
count: 1
path: modules/checkout/src/Entity/CheckoutFlow.php
-
message: "#^Method Drupal\\\\commerce_checkout\\\\Form\\\\CheckoutFlowForm\\:\\:save\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: modules/checkout/src/Form/CheckoutFlowForm.php
-
message: "#^Method Drupal\\\\commerce_checkout\\\\Plugin\\\\Commerce\\\\CheckoutPane\\\\CheckoutPaneBase\\:\\:setStepId\\(\\) should return \\$this\\(Drupal\\\\commerce_checkout\\\\Plugin\\\\Commerce\\\\CheckoutPane\\\\CheckoutPaneBase\\) but return statement is missing\\.$#"
count: 1
path: modules/checkout/src/Plugin/Commerce/CheckoutPane/CheckoutPaneBase.php
-
message: "#^Method Drupal\\\\commerce_checkout\\\\Plugin\\\\Commerce\\\\CheckoutPane\\\\CheckoutPaneBase\\:\\:setWeight\\(\\) should return \\$this\\(Drupal\\\\commerce_checkout\\\\Plugin\\\\Commerce\\\\CheckoutPane\\\\CheckoutPaneBase\\) but return statement is missing\\.$#"
count: 1
path: modules/checkout/src/Plugin/Commerce/CheckoutPane/CheckoutPaneBase.php
-
message: "#^Method Drupal\\\\commerce_checkout\\\\Plugin\\\\Commerce\\\\CheckoutPane\\\\OrderSummary\\:\\:buildConfigurationSummary\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: modules/checkout/src/Plugin/Commerce/CheckoutPane/OrderSummary.php
-
message: "#^Plugin definitions cannot be altered\\.$#"
count: 1
path: modules/log/src/LogCategoryManager.php
-
message: "#^Plugin definitions cannot be altered\\.$#"
count: 1
path: modules/log/src/LogTemplateManager.php
-
message: "#^@covers value \\\\Drupal\\\\commerce_log\\\\Plugin\\\\LogTemplate\\\\LogTemplate\\:\\:getGroup references an invalid method\\.$#"
count: 1
path: modules/log/tests/src/Unit/LogTemplateTest.php
-
message: "#^Method Drupal\\\\commerce_number_pattern\\\\Entity\\\\NumberPattern\\:\\:set\\(\\) should return \\$this\\(Drupal\\\\commerce_number_pattern\\\\Entity\\\\NumberPattern\\) but return statement is missing\\.$#"
count: 1
path: modules/number_pattern/src/Entity/NumberPattern.php
-
message: "#^Method Drupal\\\\commerce_number_pattern\\\\Form\\\\NumberPatternForm\\:\\:save\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: modules/number_pattern/src/Form/NumberPatternForm.php
-
message: "#^\\\\Drupal calls should be avoided in classes, use dependency injection instead$#"
count: 1
path: modules/order/src/Adjustment.php
-
message: "#^Method Drupal\\\\commerce_order\\\\Entity\\\\OrderType\\:\\:getNumberPattern\\(\\) should return Drupal\\\\commerce_number_pattern\\\\Entity\\\\NumberPatternInterface but return statement is missing\\.$#"
count: 1
path: modules/order/src/Entity/OrderType.php
-
message: "#^Method Drupal\\\\commerce_order\\\\Form\\\\OrderForm\\:\\:save\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: modules/order/src/Form/OrderForm.php
-
message: "#^Method Drupal\\\\commerce_order\\\\Form\\\\OrderItemTypeForm\\:\\:save\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: modules/order/src/Form/OrderItemTypeForm.php
-
message: "#^Method Drupal\\\\commerce_order\\\\Form\\\\OrderTypeForm\\:\\:save\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: modules/order/src/Form/OrderTypeForm.php
-
message: "#^Method Drupal\\\\commerce_order\\\\Form\\\\ProfileAddressBookForm\\:\\:save\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: modules/order/src/Form/ProfileAddressBookForm.php
-
message: "#^\\\\Drupal calls should be avoided in classes, use dependency injection instead$#"
count: 1
path: modules/order/src/OrderStorage.php
-
message: "#^Access to an undefined property Drupal\\\\commerce_order\\\\Plugin\\\\Field\\\\FieldType\\\\AdjustmentItem\\:\\:\\$value\\.$#"
count: 1
path: modules/order/src/Plugin/Field/FieldType/AdjustmentItem.php
-
message: "#^Method Drupal\\\\commerce_order\\\\Plugin\\\\Field\\\\FieldType\\\\AdjustmentItemList\\:\\:removeAdjustment\\(\\) should return \\$this\\(Drupal\\\\commerce_order\\\\Plugin\\\\Field\\\\FieldType\\\\AdjustmentItemList\\) but return statement is missing\\.$#"
count: 1
path: modules/order/src/Plugin/Field/FieldType/AdjustmentItemList.php
-
message: "#^\\\\Drupal calls should be avoided in classes, use dependency injection instead$#"
count: 1
path: modules/order/src/Plugin/Field/FieldWidget/AdjustmentDefaultWidget.php
-
message: "#^\\\\Drupal calls should be avoided in classes, use dependency injection instead$#"
count: 1
path: modules/order/src/Plugin/Validation/Constraint/OrderVersionConstraintValidator.php
-
message: "#^\\\\Drupal calls should be avoided in classes, use dependency injection instead$#"
count: 1
path: modules/payment/src/Controller/PaymentCheckoutController.php
-
message: "#^Method Drupal\\\\commerce_payment\\\\Entity\\\\PaymentGateway\\:\\:set\\(\\) should return \\$this\\(Drupal\\\\commerce_payment\\\\Entity\\\\PaymentGateway\\) but return statement is missing\\.$#"
count: 1
path: modules/payment/src/Entity/PaymentGateway.php
-
message: "#^Method Drupal\\\\commerce_payment\\\\Form\\\\PaymentGatewayForm\\:\\:save\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: modules/payment/src/Form/PaymentGatewayForm.php
-
message: "#^Method Drupal\\\\commerce_payment\\\\Form\\\\PaymentMethodEditForm\\:\\:save\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: modules/payment/src/Form/PaymentMethodEditForm.php
-
message: "#^\\\\Drupal calls should be avoided in classes, use dependency injection instead$#"
count: 1
path: modules/payment/src/PaymentMethodListBuilder.php
-
message: "#^Class Drupal\\\\commerce_payment\\\\PaymentMethodPermissionProvider extends @internal class Drupal\\\\entity\\\\EntityPermissionProviderBase\\.$#"
count: 1
path: modules/payment/src/PaymentMethodPermissionProvider.php
-
message: "#^\\\\Drupal calls should be avoided in classes, use dependency injection instead$#"
count: 1
path: modules/payment/tests/modules/commerce_payment_test/src/Plugin/Commerce/PaymentGateway/TestOffsite.php
-
message: "#^Method Drupal\\\\commerce_price\\\\Form\\\\CurrencyForm\\:\\:save\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: modules/price/src/Form/CurrencyForm.php
-
message: "#^Access to an undefined property Drupal\\\\commerce_price\\\\Plugin\\\\Field\\\\FieldType\\\\PriceItem\\:\\:\\$currency_code\\.$#"
count: 1
path: modules/price/src/Plugin/Field/FieldType/PriceItem.php
-
message: "#^Access to an undefined property Drupal\\\\commerce_price\\\\Plugin\\\\Field\\\\FieldType\\\\PriceItem\\:\\:\\$number\\.$#"
count: 2
path: modules/price/src/Plugin/Field/FieldType/PriceItem.php
-
message: "#^Method Drupal\\\\commerce_product\\\\Form\\\\ProductAttributeForm\\:\\:save\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: modules/product/src/Form/ProductAttributeForm.php
-
message: "#^\\\\Drupal calls should be avoided in classes, use dependency injection instead$#"
count: 3
path: modules/product/src/Form/ProductAttributeForm.php
-
message: "#^Class Drupal\\\\commerce_product\\\\Form\\\\ProductAttributeTranslationAddForm extends @internal class Drupal\\\\config_translation\\\\Form\\\\ConfigTranslationAddForm\\.$#"
count: 1
path: modules/product/src/Form/ProductAttributeTranslationAddForm.php
-
message: "#^Class Drupal\\\\commerce_product\\\\Form\\\\ProductAttributeTranslationEditForm extends @internal class Drupal\\\\config_translation\\\\Form\\\\ConfigTranslationEditForm\\.$#"
count: 1
path: modules/product/src/Form/ProductAttributeTranslationEditForm.php
-
message: "#^Method Drupal\\\\commerce_product\\\\Form\\\\ProductTypeForm\\:\\:save\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: modules/product/src/Form/ProductTypeForm.php
-
message: "#^Variable \\$types in isset\\(\\) is never defined\\.$#"
count: 1
path: modules/product/src/Form/ProductTypeForm.php
-
message: "#^Class Drupal\\\\commerce_product\\\\Plugin\\\\Block\\\\VariationFieldBlock extends @internal class Drupal\\\\layout_builder\\\\Plugin\\\\Block\\\\FieldBlock\\.$#"
count: 1
path: modules/product/src/Plugin/Block/VariationFieldBlock.php
-
message: "#^\\\\Drupal calls should be avoided in classes, use dependency injection instead$#"
count: 1
path: modules/product/src/Plugin/Validation/Constraint/ProductVariationSkuConstraintValidator.php
-
message: """
#^Call to deprecated method toRenderArray\\(\\) of class Drupal\\\\Core\\\\Url\\:
in drupal\\:10\\.1\\.0 and is removed from drupal\\:11\\.0\\.0\\. There is no
replacement\\.$#
"""
count: 1
path: modules/product/src/ProductListBuilder.php
-
message: "#^\\\\Drupal calls should be avoided in classes, use dependency injection instead$#"
count: 1
path: modules/product/src/ProductTranslationHandler.php
-
message: "#^Variable \\$coupons_id might not be defined\\.$#"
count: 1
path: modules/promotion/src/Entity/Coupon.php
-
message: "#^Variable \\$coupon in empty\\(\\) always exists and is not falsy\\.$#"
count: 1
path: modules/promotion/src/Plugin/Commerce/InlineForm/CouponRedemption.php
-
message: "#^\\\\Drupal calls should be avoided in classes, use dependency injection instead$#"
count: 1
path: modules/promotion/src/Plugin/Commerce/PromotionOffer/OrderItemPromotionOfferBase.php
-
message: "#^Method Drupal\\\\commerce_promotion\\\\Plugin\\\\views\\\\area\\\\CouponRedemption\\:\\:render\\(\\) should return array but return statement is missing\\.$#"
count: 1
path: modules/promotion/src/Plugin/views/area/CouponRedemption.php
-
message: "#^Variable \\$order_total in isset\\(\\) always exists and is not nullable\\.$#"
count: 1
path: modules/promotion/src/Plugin/views/area/CouponRedemption.php
-
message: """
#^Call to deprecated function system_time_zones\\(\\)\\:
in drupal\\:10\\.1\\.0 and is removed from drupal\\:11\\.0\\.0\\. This function
is no longer used in Drupal core\\. Use
\\\\Drupal\\\\Core\\\\Datetime\\\\TimeZoneFormHelper\\:\\:getOptionsList\\(\\) or
\\\\DateTimeZone\\:\\:listIdentifiers\\(\\) instead\\.$#
"""
count: 1
path: modules/store/src/Entity/Store.php
-
message: "#^Method Drupal\\\\commerce_store\\\\Form\\\\StoreForm\\:\\:save\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: modules/store/src/Form/StoreForm.php
-
message: "#^Method Drupal\\\\commerce_store\\\\Form\\\\StoreTypeForm\\:\\:save\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: modules/store/src/Form/StoreTypeForm.php
-
message: """
#^Call to deprecated method toRenderArray\\(\\) of class Drupal\\\\Core\\\\Url\\:
in drupal\\:10\\.1\\.0 and is removed from drupal\\:11\\.0\\.0\\. There is no
replacement\\.$#
"""
count: 1
path: modules/store/src/StoreListBuilder.php
-
message: "#^Method Drupal\\\\commerce_tax\\\\Form\\\\TaxTypeForm\\:\\:save\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: modules/tax/src/Form/TaxTypeForm.php
-
message: """
#^Access to deprecated property \\$entityId of class Drupal\\\\commerce_tax\\\\Plugin\\\\Commerce\\\\TaxType\\\\TaxTypeBase\\:
in commerce\\:8\\.x\\-2\\.16 and is removed from commerce\\:3\\.x\\.
Use \\$this\\-\\>parentEntity\\-\\>id\\(\\) instead\\.$#
"""
count: 1
path: modules/tax/src/Plugin/Commerce/TaxType/TaxTypeBase.php
-
message: "#^Access to an undefined property Drupal\\\\commerce_tax\\\\Plugin\\\\Field\\\\FieldType\\\\TaxNumberItem\\:\\:\\$type\\.$#"
count: 2
path: modules/tax/src/Plugin/Field/FieldType/TaxNumberItem.php
-
message: "#^Access to an undefined property Drupal\\\\commerce_tax\\\\Plugin\\\\Field\\\\FieldType\\\\TaxNumberItem\\:\\:\\$value\\.$#"
count: 2
path: modules/tax/src/Plugin/Field/FieldType/TaxNumberItem.php
-
message: "#^Access to an undefined property Drupal\\\\commerce_tax\\\\Plugin\\\\Field\\\\FieldType\\\\TaxNumberItem\\:\\:\\$verification_result\\.$#"
count: 1
path: modules/tax/src/Plugin/Field/FieldType/TaxNumberItem.php
-
message: "#^Access to an undefined property Drupal\\\\commerce_tax\\\\Plugin\\\\Field\\\\FieldType\\\\TaxNumberItem\\:\\:\\$verification_state\\.$#"
count: 2
path: modules/tax/src/Plugin/Field/FieldType/TaxNumberItem.php
-
message: "#^Access to an undefined property Drupal\\\\commerce_tax\\\\Plugin\\\\Field\\\\FieldType\\\\TaxNumberItem\\:\\:\\$verification_timestamp\\.$#"
count: 1
path: modules/tax/src/Plugin/Field/FieldType/TaxNumberItem.php
-
message: """
#^Call to deprecated method at\\(\\) of class PHPUnit\\\\Framework\\\\TestCase\\:
https\\://github\\.com/sebastianbergmann/phpunit/issues/4297$#
"""
count: 2
path: modules/tax/tests/src/Kernel/Plugin/Commerce/TaxNumberType/EuropeanUnionVatTest.php
-
message: "#^Trying to mock an undefined method __soapCall\\(\\) on class \\.$#"
count: 2
path: modules/tax/tests/src/Kernel/Plugin/Commerce/TaxNumberType/EuropeanUnionVatTest.php
-
message: "#^\\\\Drupal calls should be avoided in classes, use dependency injection instead$#"
count: 2
path: src/Config/ConfigUpdater.php
-
message: "#^Access to an undefined property Drupal\\\\commerce\\\\Plugin\\\\Field\\\\FieldType\\\\PluginItem\\:\\:\\$target_plugin_configuration\\.$#"
count: 1
path: src/Plugin/Field/FieldType/PluginItem.php
-
message: "#^Access to an undefined property Drupal\\\\commerce\\\\Plugin\\\\Field\\\\FieldType\\\\PluginItem\\:\\:\\$target_plugin_id\\.$#"
count: 2
path: src/Plugin/Field/FieldType/PluginItem.php
-
message: "#^Access to an undefined property \\$this\\(Drupal\\\\commerce\\\\Plugin\\\\Field\\\\FieldType\\\\RemoteIdItem\\)\\:\\:\\$remote_id\\.$#"
count: 1
path: src/Plugin/Field/FieldType/RemoteIdItem.php
# Configuration file for PHPStan static code checking, see https://phpstan.org .
includes:
# Baseline can be re-generated by running:
# PATH/TO/VENDOR/bin/phpstan analyse --autoload-file=PATH/TO/VENDOR/autoload.php ./ --generate-baseline=phpstan-baseline.neon
# in the commerce module folder root directory. Note: all composer
# dependencies must be installed including dev.
- phpstan-baseline.neon
- phar://phpstan.phar/conf/bleedingEdge.neon
parameters:
level: 1
excludePaths:
# Drupal Condole command.
- modules/store/src/Command/CreateStoreCommand.php
ignoreErrors:
# new static() is a best practice in Drupal, so we cannot fix that.
- "#^Unsafe usage of new static#"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment