From d455afafed5a1b1f4643966cb0d79b3117e56a29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toma=CC=81s=CC=8C=20Ludvik?= Date: Tue, 12 Nov 2024 16:32:32 +0100 Subject: [PATCH] resolved missing typehints reported to be introduced in next package versions --- src/Component/Constraints/CustomerUserRoleGroup.php | 3 +-- src/Component/Constraints/CustomerUserRoleGroupAllowEdit.php | 3 +-- .../Constraints/CustomerUserRoleGroupAllowEditValidator.php | 2 +- src/Component/Constraints/CustomerUserRoleGroupValidator.php | 2 +- src/Component/Constraints/DeliveryAddressUuid.php | 3 +-- src/Component/Constraints/DeliveryAddressUuidValidator.php | 2 +- src/Component/Constraints/FileUpload.php | 4 +--- src/Component/Constraints/FileUploadValidator.php | 2 +- src/Component/Constraints/PaymentInCart.php | 3 +-- src/Component/Constraints/PaymentInCartValidator.php | 2 +- src/Component/Constraints/PaymentInExistingOrder.php | 3 +-- src/Component/Constraints/PaymentInExistingOrderValidator.php | 2 +- src/Component/Constraints/PaymentInOrder.php | 3 +-- src/Component/Constraints/PaymentInOrderValidator.php | 2 +- src/Component/Constraints/PaymentTransportRelation.php | 3 +-- .../Constraints/PaymentTransportRelationValidator.php | 2 +- src/Component/Constraints/ProductInOrder.php | 3 +-- src/Component/Constraints/ProductInOrderValidator.php | 2 +- src/Component/Constraints/PromoCode.php | 3 +-- src/Component/Constraints/PromoCodeValidator.php | 2 +- src/Component/Constraints/TransportInCart.php | 3 +-- src/Component/Constraints/TransportInCartValidator.php | 2 +- src/Component/Constraints/TransportInOrder.php | 3 +-- src/Component/Constraints/TransportInOrderValidator.php | 2 +- src/Component/Constraints/UniqueBillingAddressApi.php | 3 +-- .../Constraints/UniqueBillingAddressApiValidator.php | 2 +- 26 files changed, 26 insertions(+), 40 deletions(-) diff --git a/src/Component/Constraints/CustomerUserRoleGroup.php b/src/Component/Constraints/CustomerUserRoleGroup.php index e62e5ee426..349ce26440 100644 --- a/src/Component/Constraints/CustomerUserRoleGroup.php +++ b/src/Component/Constraints/CustomerUserRoleGroup.php @@ -17,9 +17,8 @@ class CustomerUserRoleGroup extends Constraint /** * @var array - * @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint */ - protected static $errorNames = [ + protected const array ERROR_NAMES = [ self::CUSTOMER_USER_ROLE_GROUP_NOT_FOUND => 'CUSTOMER_USER_ROLE_GROUP_NOT_FOUND', ]; diff --git a/src/Component/Constraints/CustomerUserRoleGroupAllowEdit.php b/src/Component/Constraints/CustomerUserRoleGroupAllowEdit.php index fa57dca128..ac725b9e2c 100644 --- a/src/Component/Constraints/CustomerUserRoleGroupAllowEdit.php +++ b/src/Component/Constraints/CustomerUserRoleGroupAllowEdit.php @@ -20,9 +20,8 @@ class CustomerUserRoleGroupAllowEdit extends Constraint /** * @var array - * @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint */ - protected static $errorNames = [ + protected const array ERROR_NAMES = [ self::CUSTOMER_USER_ROLE_GROUP_CANNOT_BE_CHANGED => 'CUSTOMER_USER_ROLE_GROUP_CANNOT_BE_CHANGED', self::LAST_CUSTOMER_USER_ROLE_GROUP_CANNOT_BE_CHANGED => 'LAST_CUSTOMER_USER_ROLE_GROUP_CANNOT_BE_CHANGED', ]; diff --git a/src/Component/Constraints/CustomerUserRoleGroupAllowEditValidator.php b/src/Component/Constraints/CustomerUserRoleGroupAllowEditValidator.php index cb18baf7b7..adcd8b47d5 100644 --- a/src/Component/Constraints/CustomerUserRoleGroupAllowEditValidator.php +++ b/src/Component/Constraints/CustomerUserRoleGroupAllowEditValidator.php @@ -31,7 +31,7 @@ public function __construct( * @param mixed $value * @param \Symfony\Component\Validator\Constraint $constraint */ - public function validate($value, Constraint $constraint): void + public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof CustomerUserRoleGroupAllowEdit) { throw new UnexpectedTypeException($constraint, CustomerUserRoleGroupAllowEdit::class); diff --git a/src/Component/Constraints/CustomerUserRoleGroupValidator.php b/src/Component/Constraints/CustomerUserRoleGroupValidator.php index 5a9d82513d..5fd664ae34 100644 --- a/src/Component/Constraints/CustomerUserRoleGroupValidator.php +++ b/src/Component/Constraints/CustomerUserRoleGroupValidator.php @@ -24,7 +24,7 @@ public function __construct( * @param mixed $value * @param \Symfony\Component\Validator\Constraint $constraint */ - public function validate($value, Constraint $constraint) + public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof CustomerUserRoleGroup) { throw new UnexpectedTypeException($constraint, CustomerUserRoleGroup::class); diff --git a/src/Component/Constraints/DeliveryAddressUuid.php b/src/Component/Constraints/DeliveryAddressUuid.php index b73d68fcfe..067c053bbd 100644 --- a/src/Component/Constraints/DeliveryAddressUuid.php +++ b/src/Component/Constraints/DeliveryAddressUuid.php @@ -14,9 +14,8 @@ class DeliveryAddressUuid extends Constraint /** * @var array - * @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint */ - protected static $errorNames = [ + protected const array ERROR_NAMES = [ self::LOGIN_REQUIRED_ERROR => 'LOGIN_REQUIRED_ERROR', ]; diff --git a/src/Component/Constraints/DeliveryAddressUuidValidator.php b/src/Component/Constraints/DeliveryAddressUuidValidator.php index 2c6f6415e3..bc9172578b 100644 --- a/src/Component/Constraints/DeliveryAddressUuidValidator.php +++ b/src/Component/Constraints/DeliveryAddressUuidValidator.php @@ -24,7 +24,7 @@ public function __construct( * {@inheritdoc} */ #[Override] - public function validate($value, Constraint $constraint): void + public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof DeliveryAddressUuid) { throw new UnexpectedTypeException($constraint, DeliveryAddressUuid::class); diff --git a/src/Component/Constraints/FileUpload.php b/src/Component/Constraints/FileUpload.php index 36117f82c8..cadfbab185 100644 --- a/src/Component/Constraints/FileUpload.php +++ b/src/Component/Constraints/FileUpload.php @@ -14,10 +14,8 @@ class FileUpload extends Constraint /** * @var array - * @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint - * @phpcsSuppress SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnlySniff.ReferenceViaFullyQualifiedName */ - protected static $errorNames = [ + protected const array ERROR_NAMES = [ self::TOO_BIG_ERROR => 'TOO_BIG_ERROR', self::UPLOAD_ERROR => 'UPLOAD_ERROR', self::MIMETYPE_ERROR => 'MIMETYPE_ERROR', diff --git a/src/Component/Constraints/FileUploadValidator.php b/src/Component/Constraints/FileUploadValidator.php index 4ce5e81506..8727953d9e 100644 --- a/src/Component/Constraints/FileUploadValidator.php +++ b/src/Component/Constraints/FileUploadValidator.php @@ -16,7 +16,7 @@ class FileUploadValidator extends ConstraintValidator * @param mixed $value * @param \Symfony\Component\Validator\Constraint $constraint */ - public function validate($value, Constraint $constraint): void + public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof FileUpload) { throw new UnexpectedTypeException($constraint, FileUpload::class); diff --git a/src/Component/Constraints/PaymentInCart.php b/src/Component/Constraints/PaymentInCart.php index 57c2e0d03b..fae6b3c61f 100644 --- a/src/Component/Constraints/PaymentInCart.php +++ b/src/Component/Constraints/PaymentInCart.php @@ -17,9 +17,8 @@ class PaymentInCart extends Constraint /** * @var array - * @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint */ - protected static $errorNames = [ + protected const array ERROR_NAMES = [ self::UNAVAILABLE_PAYMENT_ERROR => 'UNAVAILABLE_PAYMENT_ERROR', self::INVALID_PAYMENT_TRANSPORT_COMBINATION_ERROR => 'INVALID_PAYMENT_TRANSPORT_COMBINATION_ERROR', ]; diff --git a/src/Component/Constraints/PaymentInCartValidator.php b/src/Component/Constraints/PaymentInCartValidator.php index 2cde994750..3ad6ab1dd8 100644 --- a/src/Component/Constraints/PaymentInCartValidator.php +++ b/src/Component/Constraints/PaymentInCartValidator.php @@ -32,7 +32,7 @@ public function __construct( * @param mixed $value * @param \Shopsys\FrontendApiBundle\Component\Constraints\PaymentInCart $constraint */ - public function validate($value, Constraint $constraint) + public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof PaymentInCart) { throw new UnexpectedTypeException($constraint, PaymentInCart::class); diff --git a/src/Component/Constraints/PaymentInExistingOrder.php b/src/Component/Constraints/PaymentInExistingOrder.php index 7fc09b1e0a..f7075a429f 100644 --- a/src/Component/Constraints/PaymentInExistingOrder.php +++ b/src/Component/Constraints/PaymentInExistingOrder.php @@ -20,9 +20,8 @@ class PaymentInExistingOrder extends Constraint /** * @var array - * @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint */ - protected static $errorNames = [ + protected const array ERROR_NAMES = [ self::UNAVAILABLE_PAYMENT_ERROR => 'UNAVAILABLE_PAYMENT_ERROR', self::UNCHANGEABLE_PAYMENT_ERROR => 'UNCHANGEABLE_PAYMENT_ERROR', self::INVALID_PAYMENT_SWIFT_ERROR => 'INVALID_PAYMENT_SWIFT_ERROR', diff --git a/src/Component/Constraints/PaymentInExistingOrderValidator.php b/src/Component/Constraints/PaymentInExistingOrderValidator.php index b3baadecd8..2cebd12100 100644 --- a/src/Component/Constraints/PaymentInExistingOrderValidator.php +++ b/src/Component/Constraints/PaymentInExistingOrderValidator.php @@ -35,7 +35,7 @@ public function __construct( * @param mixed $value * @param \Symfony\Component\Validator\Constraint $constraint */ - public function validate($value, Constraint $constraint): void + public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof PaymentInExistingOrder) { throw new UnexpectedTypeException($constraint, PaymentInExistingOrder::class); diff --git a/src/Component/Constraints/PaymentInOrder.php b/src/Component/Constraints/PaymentInOrder.php index 10d2f5e6f6..788fcc705a 100644 --- a/src/Component/Constraints/PaymentInOrder.php +++ b/src/Component/Constraints/PaymentInOrder.php @@ -20,9 +20,8 @@ class PaymentInOrder extends Constraint /** * @var array - * @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint */ - protected static $errorNames = [ + protected const array ERROR_NAMES = [ self::PAYMENT_NOT_SET_ERROR => 'PAYMENT_NOT_SET_ERROR', self::UNAVAILABLE_PAYMENT_ERROR => 'UNAVAILABLE_PAYMENT_ERROR', self::CHANGED_PAYMENT_PRICE_ERROR => 'CHANGED_PAYMENT_PRICE_ERROR', diff --git a/src/Component/Constraints/PaymentInOrderValidator.php b/src/Component/Constraints/PaymentInOrderValidator.php index d18eefd586..b28f700b64 100644 --- a/src/Component/Constraints/PaymentInOrderValidator.php +++ b/src/Component/Constraints/PaymentInOrderValidator.php @@ -29,7 +29,7 @@ public function __construct( * @param mixed $value * @param \Shopsys\FrontendApiBundle\Component\Constraints\PaymentInOrder $constraint */ - public function validate($value, Constraint $constraint) + public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof PaymentInOrder) { throw new UnexpectedTypeException($constraint, PaymentInOrder::class); diff --git a/src/Component/Constraints/PaymentTransportRelation.php b/src/Component/Constraints/PaymentTransportRelation.php index 28b301f780..8a0177ba35 100644 --- a/src/Component/Constraints/PaymentTransportRelation.php +++ b/src/Component/Constraints/PaymentTransportRelation.php @@ -17,9 +17,8 @@ class PaymentTransportRelation extends Constraint /** * @var array - * @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint */ - protected static $errorNames = [ + protected const array ERROR_NAMES = [ self::INVALID_COMBINATION_ERROR => 'INVALID_COMBINATION_ERROR', ]; diff --git a/src/Component/Constraints/PaymentTransportRelationValidator.php b/src/Component/Constraints/PaymentTransportRelationValidator.php index 12b0c8076a..33b3a39593 100644 --- a/src/Component/Constraints/PaymentTransportRelationValidator.php +++ b/src/Component/Constraints/PaymentTransportRelationValidator.php @@ -26,7 +26,7 @@ public function __construct( * @param mixed $value * @param \Symfony\Component\Validator\Constraint $constraint */ - public function validate($value, Constraint $constraint): void + public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof PaymentTransportRelation) { throw new UnexpectedTypeException($constraint, PaymentTransportRelation::class); diff --git a/src/Component/Constraints/ProductInOrder.php b/src/Component/Constraints/ProductInOrder.php index da20b400ae..5c7471c273 100644 --- a/src/Component/Constraints/ProductInOrder.php +++ b/src/Component/Constraints/ProductInOrder.php @@ -14,9 +14,8 @@ class ProductInOrder extends Constraint /** * @var array - * @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint */ - protected static $errorNames = [ + protected const array ERROR_NAMES = [ self::NO_PRODUCT_IN_ORDER_ERROR => 'NO_PRODUCT_IN_ORDER_ERROR', ]; diff --git a/src/Component/Constraints/ProductInOrderValidator.php b/src/Component/Constraints/ProductInOrderValidator.php index a197a0bdea..797c848e34 100644 --- a/src/Component/Constraints/ProductInOrderValidator.php +++ b/src/Component/Constraints/ProductInOrderValidator.php @@ -26,7 +26,7 @@ public function __construct( * @param mixed $value * @param \Shopsys\FrontendApiBundle\Component\Constraints\ProductInOrder $constraint */ - public function validate($value, Constraint $constraint): void + public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof ProductInOrder) { throw new UnexpectedTypeException($constraint, ProductInOrder::class); diff --git a/src/Component/Constraints/PromoCode.php b/src/Component/Constraints/PromoCode.php index d381ab3558..61ab23cf17 100644 --- a/src/Component/Constraints/PromoCode.php +++ b/src/Component/Constraints/PromoCode.php @@ -38,9 +38,8 @@ class PromoCode extends Constraint /** * @var array - * @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint */ - protected static $errorNames = [ + protected const array ERROR_NAMES = [ self::INVALID_ERROR => 'INVALID_ERROR', self::NOT_YET_VALID_ERROR => 'NOT_YET_VALID_ERROR', self::NO_LONGER_VALID_ERROR => 'NO_LONGER_VALID_ERROR', diff --git a/src/Component/Constraints/PromoCodeValidator.php b/src/Component/Constraints/PromoCodeValidator.php index 24482d0847..ecdc516f19 100644 --- a/src/Component/Constraints/PromoCodeValidator.php +++ b/src/Component/Constraints/PromoCodeValidator.php @@ -36,7 +36,7 @@ public function __construct( * @param mixed $value * @param \Symfony\Component\Validator\Constraint $constraint */ - public function validate($value, Constraint $constraint) + public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof PromoCode) { throw new UnexpectedTypeException($constraint, PromoCode::class); diff --git a/src/Component/Constraints/TransportInCart.php b/src/Component/Constraints/TransportInCart.php index c8070a3045..f4e5822a70 100644 --- a/src/Component/Constraints/TransportInCart.php +++ b/src/Component/Constraints/TransportInCart.php @@ -26,9 +26,8 @@ class TransportInCart extends Constraint /** * @var array - * @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint */ - protected static $errorNames = [ + protected const array ERROR_NAMES = [ self::UNAVAILABLE_TRANSPORT_ERROR => 'UNAVAILABLE_TRANSPORT_ERROR', self::UNAVAILABLE_PICKUP_PLACE_ERROR => 'UNAVAILABLE_PICKUP_PLACE_ERROR', self::WEIGHT_LIMIT_EXCEEDED_ERROR => 'WEIGHT_LIMIT_EXCEEDED_ERROR', diff --git a/src/Component/Constraints/TransportInCartValidator.php b/src/Component/Constraints/TransportInCartValidator.php index c28589ca3a..dfbd2aca16 100644 --- a/src/Component/Constraints/TransportInCartValidator.php +++ b/src/Component/Constraints/TransportInCartValidator.php @@ -42,7 +42,7 @@ public function __construct( * @param mixed $value * @param \Shopsys\FrontendApiBundle\Component\Constraints\TransportInCart $constraint */ - public function validate($value, Constraint $constraint) + public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof TransportInCart) { throw new UnexpectedTypeException($constraint, TransportInCart::class); diff --git a/src/Component/Constraints/TransportInOrder.php b/src/Component/Constraints/TransportInOrder.php index b220403ca8..59fdf18668 100644 --- a/src/Component/Constraints/TransportInOrder.php +++ b/src/Component/Constraints/TransportInOrder.php @@ -29,9 +29,8 @@ class TransportInOrder extends Constraint /** * @var array - * @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint */ - protected static $errorNames = [ + protected const array ERROR_NAMES = [ self::TRANSPORT_NOT_SET_ERROR => 'TRANSPORT_NOT_SET_ERROR', self::TRANSPORT_UNAVAILABLE_ERROR => 'TRANSPORT_UNAVAILABLE_ERROR', self::CHANGED_TRANSPORT_PRICE_ERROR => 'CHANGED_TRANSPORT_PRICE_ERROR', diff --git a/src/Component/Constraints/TransportInOrderValidator.php b/src/Component/Constraints/TransportInOrderValidator.php index 1770b21832..eb08356db5 100644 --- a/src/Component/Constraints/TransportInOrderValidator.php +++ b/src/Component/Constraints/TransportInOrderValidator.php @@ -34,7 +34,7 @@ public function __construct( * @param mixed $value * @param \Symfony\Component\Validator\Constraint $constraint */ - public function validate($value, Constraint $constraint) + public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof TransportInOrder) { throw new UnexpectedTypeException($constraint, TransportInOrder::class); diff --git a/src/Component/Constraints/UniqueBillingAddressApi.php b/src/Component/Constraints/UniqueBillingAddressApi.php index a8e738944c..b479a57fcf 100644 --- a/src/Component/Constraints/UniqueBillingAddressApi.php +++ b/src/Component/Constraints/UniqueBillingAddressApi.php @@ -17,9 +17,8 @@ class UniqueBillingAddressApi extends Constraint /** * @var array - * @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint */ - protected static $errorNames = [ + protected const array ERROR_NAMES = [ self::DUPLICATE_BILLING_ADDRESS => 'DUPLICATE_BILLING_ADDRESS', ]; diff --git a/src/Component/Constraints/UniqueBillingAddressApiValidator.php b/src/Component/Constraints/UniqueBillingAddressApiValidator.php index 3881f77738..a00c57ef32 100644 --- a/src/Component/Constraints/UniqueBillingAddressApiValidator.php +++ b/src/Component/Constraints/UniqueBillingAddressApiValidator.php @@ -30,7 +30,7 @@ public function __construct( * @param mixed $value * @param \Symfony\Component\Validator\Constraint $constraint */ - public function validate($value, Constraint $constraint) + public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof UniqueBillingAddressApi) { throw new UnexpectedTypeException($constraint, UniqueBillingAddressApi::class);