diff --git a/composer.json b/composer.json index dcbae1efc..d76fb466d 100644 --- a/composer.json +++ b/composer.json @@ -32,11 +32,11 @@ "shopsys/framework": "16.0.x-dev", "shopsys/migrations": "16.0.x-dev", "shopsys/plugin-interface": "16.0.x-dev", - "symfony/config": "^5.4", - "symfony/dependency-injection": "^5.4", - "symfony/http-foundation": "^5.4", - "symfony/http-kernel": "^5.4", - "symfony/routing": "^5.4", + "symfony/config": "^6.4", + "symfony/dependency-injection": "^6.4", + "symfony/http-foundation": "^6.4", + "symfony/http-kernel": "^6.4", + "symfony/routing": "^6.4", "webonyx/graphql-php": "^15.6" }, "require-dev": { diff --git a/src/Component/Constraints/CustomerUserRoleGroup.php b/src/Component/Constraints/CustomerUserRoleGroup.php index e62e5ee42..349ce2644 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 fa57dca12..ac725b9e2 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 cb18baf7b..adcd8b47d 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 5a9d82513..5fd664ae3 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 b73d68fcf..067c053bb 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 2c6f6415e..bc9172578 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 36117f82c..cadfbab18 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 4ce5e8150..8727953d9 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 57c2e0d03..fae6b3c61 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 2cde99475..3ad6ab1dd 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 7fc09b1e0..f7075a429 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 b3baadecd..2cebd1210 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 10d2f5e6f..788fcc705 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 d18eefd58..b28f700b6 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 28b301f78..8a0177ba3 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 12b0c8076..33b3a3959 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 da20b400a..5c7471c27 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 a197a0bde..797c848e3 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 d381ab355..61ab23cf1 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 24482d084..ecdc516f1 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 c8070a304..f4e5822a7 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 c28589ca3..dfbd2aca1 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 b220403ca..59fdf1866 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 1770b2183..eb08356db 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 a8e738944..b479a57fc 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 3881f7773..a00c57ef3 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); diff --git a/src/Voter/AbstractB2bVoter.php b/src/Voter/AbstractB2bVoter.php index 2eab39ee0..5f0aeffee 100644 --- a/src/Voter/AbstractB2bVoter.php +++ b/src/Voter/AbstractB2bVoter.php @@ -22,8 +22,9 @@ public function __construct(protected readonly Domain $domain) /** * @param string $attribute * @param array $subject + * @return bool */ - abstract protected function supports(string $attribute, $subject); + abstract protected function supports(string $attribute, $subject): bool; /** * @param string $attribute @@ -36,8 +37,9 @@ abstract protected function checkAccess(string $attribute, ?Argument $argument, * @param string $attribute * @param mixed $subject * @param \Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token + * @return bool */ - protected function voteOnAttribute(string $attribute, $subject, TokenInterface $token) + protected function voteOnAttribute(string $attribute, $subject, TokenInterface $token): bool { if ($this->domain->isB2b() === false) { return false; diff --git a/src/Voter/CompanyOwnerVoter.php b/src/Voter/CompanyOwnerVoter.php index b7d79d94f..a9938282b 100644 --- a/src/Voter/CompanyOwnerVoter.php +++ b/src/Voter/CompanyOwnerVoter.php @@ -29,8 +29,9 @@ public function __construct( /** * @param string $attribute * @param mixed $subject + * @return bool */ - protected function supports(string $attribute, $subject) + protected function supports(string $attribute, $subject): bool { return $attribute === 'is_company_owner_voter'; }