Skip to content

Commit

Permalink
resolved missing typehints reported to be introduced in next package …
Browse files Browse the repository at this point in the history
…versions
  • Loading branch information
TomasLudvik committed Nov 25, 2024
1 parent fd5b4d5 commit d455afa
Show file tree
Hide file tree
Showing 26 changed files with 26 additions and 40 deletions.
3 changes: 1 addition & 2 deletions src/Component/Constraints/CustomerUserRoleGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ class CustomerUserRoleGroup extends Constraint

/**
* @var array<string, string>
* @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',
];

Expand Down
3 changes: 1 addition & 2 deletions src/Component/Constraints/CustomerUserRoleGroupAllowEdit.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ class CustomerUserRoleGroupAllowEdit extends Constraint

/**
* @var array<string, string>
* @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',
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions src/Component/Constraints/DeliveryAddressUuid.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ class DeliveryAddressUuid extends Constraint

/**
* @var array<string, string>
* @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint
*/
protected static $errorNames = [
protected const array ERROR_NAMES = [
self::LOGIN_REQUIRED_ERROR => 'LOGIN_REQUIRED_ERROR',
];

Expand Down
2 changes: 1 addition & 1 deletion src/Component/Constraints/DeliveryAddressUuidValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 1 addition & 3 deletions src/Component/Constraints/FileUpload.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ class FileUpload extends Constraint

/**
* @var array<string, string>
* @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',
Expand Down
2 changes: 1 addition & 1 deletion src/Component/Constraints/FileUploadValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions src/Component/Constraints/PaymentInCart.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ class PaymentInCart extends Constraint

/**
* @var array<string, string>
* @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',
];
Expand Down
2 changes: 1 addition & 1 deletion src/Component/Constraints/PaymentInCartValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions src/Component/Constraints/PaymentInExistingOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ class PaymentInExistingOrder extends Constraint

/**
* @var array<string, string>
* @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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions src/Component/Constraints/PaymentInOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ class PaymentInOrder extends Constraint

/**
* @var array<string, string>
* @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',
Expand Down
2 changes: 1 addition & 1 deletion src/Component/Constraints/PaymentInOrderValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions src/Component/Constraints/PaymentTransportRelation.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ class PaymentTransportRelation extends Constraint

/**
* @var array<string, string>
* @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint
*/
protected static $errorNames = [
protected const array ERROR_NAMES = [
self::INVALID_COMBINATION_ERROR => 'INVALID_COMBINATION_ERROR',
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions src/Component/Constraints/ProductInOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ class ProductInOrder extends Constraint

/**
* @var array<string, string>
* @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint
*/
protected static $errorNames = [
protected const array ERROR_NAMES = [
self::NO_PRODUCT_IN_ORDER_ERROR => 'NO_PRODUCT_IN_ORDER_ERROR',
];

Expand Down
2 changes: 1 addition & 1 deletion src/Component/Constraints/ProductInOrderValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions src/Component/Constraints/PromoCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ class PromoCode extends Constraint

/**
* @var array<string, string>
* @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',
Expand Down
2 changes: 1 addition & 1 deletion src/Component/Constraints/PromoCodeValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions src/Component/Constraints/TransportInCart.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ class TransportInCart extends Constraint

/**
* @var array<string, string>
* @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',
Expand Down
2 changes: 1 addition & 1 deletion src/Component/Constraints/TransportInCartValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions src/Component/Constraints/TransportInOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ class TransportInOrder extends Constraint

/**
* @var array<string, string>
* @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',
Expand Down
2 changes: 1 addition & 1 deletion src/Component/Constraints/TransportInOrderValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions src/Component/Constraints/UniqueBillingAddressApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ class UniqueBillingAddressApi extends Constraint

/**
* @var array<string, string>
* @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint
*/
protected static $errorNames = [
protected const array ERROR_NAMES = [
self::DUPLICATE_BILLING_ADDRESS => 'DUPLICATE_BILLING_ADDRESS',
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d455afa

Please sign in to comment.