From 42d08db4c1a4532033d895f570514b4ef44ddc2c Mon Sep 17 00:00:00 2001 From: Kedar Khaire Date: Wed, 23 Oct 2024 21:09:17 +0530 Subject: [PATCH 1/5] Suppressing the LessSpecificImplementedReturnType error --- src/Serializer/EntitySerializer.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Serializer/EntitySerializer.php b/src/Serializer/EntitySerializer.php index d78d6c84..8c0cca60 100755 --- a/src/Serializer/EntitySerializer.php +++ b/src/Serializer/EntitySerializer.php @@ -34,6 +34,8 @@ use TypeError; /** + * @psalm-suppress LessSpecificImplementedReturnType + * * Serializes, normalizes and denormalizes entities. */ class EntitySerializer implements EntitySerializerInterface From 9e0de8573859c721104925553a3fb9a8f380f6a6 Mon Sep 17 00:00:00 2001 From: Kedar Khaire Date: Thu, 24 Oct 2024 13:07:16 +0530 Subject: [PATCH 2/5] Updated for specific function --- src/Serializer/EntitySerializer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Serializer/EntitySerializer.php b/src/Serializer/EntitySerializer.php index 8c0cca60..cfe116b0 100755 --- a/src/Serializer/EntitySerializer.php +++ b/src/Serializer/EntitySerializer.php @@ -34,8 +34,6 @@ use TypeError; /** - * @psalm-suppress LessSpecificImplementedReturnType - * * Serializes, normalizes and denormalizes entities. */ class EntitySerializer implements EntitySerializerInterface @@ -223,6 +221,8 @@ public function supportsEncoding($format): bool } /** + * @psalm-suppress LessSpecificImplementedReturnType + * * {@inheritdoc} */ public function getSupportedTypes(?string $format): array From 8eb0a226db553475442e000ccc8fa444ee65b67c Mon Sep 17 00:00:00 2001 From: Kedar Khaire Date: Thu, 24 Oct 2024 13:13:08 +0530 Subject: [PATCH 3/5] Changes for PHPCS --- src/Serializer/EntitySerializer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Serializer/EntitySerializer.php b/src/Serializer/EntitySerializer.php index cfe116b0..2345386b 100755 --- a/src/Serializer/EntitySerializer.php +++ b/src/Serializer/EntitySerializer.php @@ -221,9 +221,9 @@ public function supportsEncoding($format): bool } /** - * @psalm-suppress LessSpecificImplementedReturnType - * * {@inheritdoc} + * + * @psalm-suppress LessSpecificImplementedReturnType */ public function getSupportedTypes(?string $format): array { From 4cb13e1a5a1343ac5100ca8d8a67202ce4867901 Mon Sep 17 00:00:00 2001 From: Kedar Khaire Date: Fri, 25 Oct 2024 12:18:42 +0530 Subject: [PATCH 4/5] Fixes for composer test --- .../Denormalizer/AcceptedRatePlanDenormalizer.php | 4 ++-- .../ApigeeX/Denormalizer/ApiProductDenormalizer.php | 2 +- src/Api/ApigeeX/Denormalizer/AppDenormalizer.php | 4 ++-- .../Denormalizer/AppGroupMembershipDenormalizer.php | 4 ++-- .../ApigeeX/Denormalizer/BillingTypeDenormalizer.php | 4 ++-- .../DeveloperAcceptedRatePlanDenormalizer.php | 6 +++--- .../DeveloperBillingTypeDenormalizer.php | 6 +++--- .../Denormalizer/PrepaidBalanceDenormalizer.php | 2 +- .../ApigeeX/Denormalizer/RatePlanDenormalizer.php | 4 ++-- .../Denormalizer/RatePlanDenormalizerFactory.php | 8 ++++---- .../Denormalizer/RatePlanRateDenormalizer.php | 4 ++-- .../Denormalizer/StandardRatePlanDenormalizer.php | 6 +++--- .../Normalizer/AcceptedRatePlanNormalizer.php | 2 +- src/Api/ApigeeX/Normalizer/ApiProductNormalizer.php | 2 +- .../Normalizer/AppGroupMembershipNormalizer.php | 2 +- src/Api/ApigeeX/Normalizer/AppNormalizer.php | 2 +- src/Api/ApigeeX/Normalizer/BillingTypeNormalizer.php | 2 +- .../ApigeeX/Normalizer/PrepaidBalanceNormalizer.php | 2 +- src/Api/ApigeeX/Normalizer/RatePlanNormalizer.php | 2 +- .../ApigeeX/Normalizer/RatePlanNormalizerFactory.php | 4 ++-- .../ApigeeX/Normalizer/RatePlanRateNormalizer.php | 2 +- .../Normalizer/StandardRatePlanNormalizer.php | 2 +- src/Api/Management/Denormalizer/AppDenormalizer.php | 4 ++-- .../Denormalizer/CompanyMembershipDenormalizer.php | 4 ++-- .../Normalizer/AppCredentialNormalizer.php | 2 +- src/Api/Management/Normalizer/AppNormalizer.php | 2 +- .../Normalizer/CompanyMembershipNormalizer.php | 4 ++-- src/Api/Management/Query/StatsQueryNormalizer.php | 2 +- .../Denormalizer/AcceptedRatePlanDenormalizer.php | 4 ++-- .../Denormalizer/AddressDenormalizer.php | 2 +- .../Denormalizer/ApiPackageDenormalizer.php | 2 +- .../Denormalizer/BalanceDenormalizer.php | 2 +- .../CompanyAcceptedRatePlanDenormalizer.php | 6 +++--- .../CompanyPaymentTransactionDenormalizer.php | 6 +++--- .../Denormalizer/CompanyRatePlanDenormalizer.php | 6 +++--- .../CompanyReportDefinitionDenormalizer.php | 6 +++--- .../Denormalizer/DateTimeZoneDenormalizer.php | 4 ++-- .../DeveloperAcceptedRatePlanDenormalizer.php | 6 +++--- .../DeveloperCategoryRatePlanDenormalizer.php | 6 +++--- .../DeveloperPaymentTransactionDenormalizer.php | 6 +++--- .../Denormalizer/DeveloperRatePlanDenormalizer.php | 6 +++--- .../DeveloperReportDefinitionDenormalizer.php | 6 +++--- .../Denormalizer/LegalEntityDenormalizer.php | 4 ++-- .../Denormalizer/OrganizationProfileDenormalizer.php | 2 +- .../Denormalizer/PaymentTransactionDenormalizer.php | 2 +- .../Denormalizer/PrepaidBalanceDenormalizer.php | 2 +- .../Denormalizer/RatePlanDenormalizer.php | 4 ++-- .../Denormalizer/RatePlanDenormalizerFactory.php | 8 ++++---- .../Denormalizer/RatePlanRateDenormalizer.php | 4 ++-- .../Denormalizer/ReportCriteriaDenormalizer.php | 4 ++-- .../Denormalizer/ReportDefinitionDenormalizer.php | 2 +- .../Denormalizer/StandardRatePlanDenormalizer.php | 6 +++--- .../Denormalizer/SupportedCurrencyDenormalizer.php | 2 +- .../Denormalizer/TermsAndConditionsDenormalizer.php | 4 ++-- .../Normalizer/AcceptedRatePlanNormalizer.php | 2 +- .../Monetization/Normalizer/AddressNormalizer.php | 2 +- .../Monetization/Normalizer/ApiPackageNormalizer.php | 2 +- .../Monetization/Normalizer/BalanceNormalizer.php | 2 +- .../Normalizer/CompanyAcceptedRatePlanNormalizer.php | 2 +- .../CompanyPaymentTransactionNormalizer.php | 2 +- .../Normalizer/CompanyRatePlanNormalizer.php | 2 +- .../Normalizer/CompanyReportDefinitionNormalizer.php | 2 +- .../Normalizer/DateTimeZoneNormalizer.php | 2 +- .../DeveloperCategoryRatePlanNormalizer.php | 2 +- .../DeveloperPaymentTransactionNormalizer.php | 2 +- .../Normalizer/DeveloperRatePlanNormalizer.php | 2 +- .../DeveloperReportDefinitionNormalizer.php | 2 +- .../Normalizer/LegalEntityNormalizer.php | 2 +- .../LegalEntityReportDefinitionNormalizer.php | 1 - .../Normalizer/OrganizationProfileNormalizer.php | 2 +- .../Normalizer/PaymentTransactionNormalizer.php | 2 +- .../Normalizer/PrepaidBalanceNormalizer.php | 2 +- .../Monetization/Normalizer/RatePlanNormalizer.php | 2 +- .../Normalizer/RatePlanNormalizerFactory.php | 4 ++-- .../Normalizer/RatePlanRateNormalizer.php | 2 +- .../Normalizer/ReportCriteriaNormalizer.php | 2 +- .../Normalizer/ReportDefinitionNormalizer.php | 2 +- .../Normalizer/StandardRatePlanNormalizer.php | 2 +- .../Normalizer/SupportedCurrencyNormalizer.php | 2 +- .../Normalizer/TermsAndConditionsNormalizer.php | 2 +- .../Serializer/ReportDefinitionSerializer.php | 2 +- src/Denormalizer/AttributesPropertyDenormalizer.php | 4 ++-- src/Denormalizer/CredentialProductDenormalizer.php | 4 ++-- src/Denormalizer/EdgeDateDenormalizer.php | 4 ++-- src/Denormalizer/KeyValueMapDenormalizer.php | 4 ++-- src/Denormalizer/ObjectDenormalizer.php | 6 +++--- src/Denormalizer/PropertiesPropertyDenormalizer.php | 4 ++-- src/Normalizer/CredentialProductNormalizer.php | 4 ++-- src/Normalizer/EdgeDateNormalizer.php | 2 +- src/Normalizer/KeyValueMapNormalizer.php | 2 +- src/Normalizer/ObjectNormalizer.php | 8 ++++---- src/Normalizer/PropertiesPropertyNormalizer.php | 4 ++-- src/Serializer/EntitySerializer.php | 12 ++++++------ src/Serializer/JsonDecode.php | 2 +- 94 files changed, 160 insertions(+), 161 deletions(-) diff --git a/src/Api/ApigeeX/Denormalizer/AcceptedRatePlanDenormalizer.php b/src/Api/ApigeeX/Denormalizer/AcceptedRatePlanDenormalizer.php index c2131b70..ebc4e910 100755 --- a/src/Api/ApigeeX/Denormalizer/AcceptedRatePlanDenormalizer.php +++ b/src/Api/ApigeeX/Denormalizer/AcceptedRatePlanDenormalizer.php @@ -32,7 +32,7 @@ abstract class AcceptedRatePlanDenormalizer extends ObjectDenormalizer * @psalm-suppress PossiblyNullReference - getPackage() can only return * null when a rate plan is created. It does not return null here. */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { /** @var AcceptedRatePlanInterface $denormalized */ $denormalized = parent::denormalize($data, $type, $format, $context); @@ -43,7 +43,7 @@ public function denormalize($data, $type, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { // Do not apply this on array objects. ArrayDenormalizer takes care of them. if ('[]' === substr($type, -2)) { diff --git a/src/Api/ApigeeX/Denormalizer/ApiProductDenormalizer.php b/src/Api/ApigeeX/Denormalizer/ApiProductDenormalizer.php index 6b086aa1..17b950fb 100755 --- a/src/Api/ApigeeX/Denormalizer/ApiProductDenormalizer.php +++ b/src/Api/ApigeeX/Denormalizer/ApiProductDenormalizer.php @@ -45,7 +45,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { // Do not apply this on array objects. ArrayDenormalizer takes care of them. if ('[]' === substr($type, -2)) { diff --git a/src/Api/ApigeeX/Denormalizer/AppDenormalizer.php b/src/Api/ApigeeX/Denormalizer/AppDenormalizer.php index dc427053..63be5b09 100644 --- a/src/Api/ApigeeX/Denormalizer/AppDenormalizer.php +++ b/src/Api/ApigeeX/Denormalizer/AppDenormalizer.php @@ -46,7 +46,7 @@ class AppDenormalizer extends ObjectDenormalizer /** * {@inheritdoc} */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { if (isset($data->developerId)) { return parent::denormalize($data, $this->developerAppClass, $format, $context); @@ -61,7 +61,7 @@ public function denormalize($data, $type, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { // Do not apply this on array objects. ArrayDenormalizer takes care of them. if ('[]' === substr($type, -2)) { diff --git a/src/Api/ApigeeX/Denormalizer/AppGroupMembershipDenormalizer.php b/src/Api/ApigeeX/Denormalizer/AppGroupMembershipDenormalizer.php index d6f23fe4..47117e15 100644 --- a/src/Api/ApigeeX/Denormalizer/AppGroupMembershipDenormalizer.php +++ b/src/Api/ApigeeX/Denormalizer/AppGroupMembershipDenormalizer.php @@ -29,7 +29,7 @@ class AppGroupMembershipDenormalizer implements DenormalizerInterface /** * {@inheritdoc} */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { $denormalized = []; if (!empty($data['attributes'])) { @@ -52,7 +52,7 @@ public function denormalize($data, $type, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { // Do not apply this on array objects. ArrayDenormalizer takes care of them. if ('[]' === substr($type, -2)) { diff --git a/src/Api/ApigeeX/Denormalizer/BillingTypeDenormalizer.php b/src/Api/ApigeeX/Denormalizer/BillingTypeDenormalizer.php index fbf3c232..f5e73ca1 100644 --- a/src/Api/ApigeeX/Denormalizer/BillingTypeDenormalizer.php +++ b/src/Api/ApigeeX/Denormalizer/BillingTypeDenormalizer.php @@ -26,7 +26,7 @@ abstract class BillingTypeDenormalizer extends ObjectDenormalizer /** * {@inheritdoc} */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { /** @var BillingTypeInterface $denormalized */ $denormalized = parent::denormalize($data, $type, $format, $context); @@ -37,7 +37,7 @@ public function denormalize($data, $type, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { // Do not apply this on array objects. ArrayDenormalizer takes care of them. if ('[]' === substr($type, -2)) { diff --git a/src/Api/ApigeeX/Denormalizer/DeveloperAcceptedRatePlanDenormalizer.php b/src/Api/ApigeeX/Denormalizer/DeveloperAcceptedRatePlanDenormalizer.php index ceb6b434..9f356a17 100755 --- a/src/Api/ApigeeX/Denormalizer/DeveloperAcceptedRatePlanDenormalizer.php +++ b/src/Api/ApigeeX/Denormalizer/DeveloperAcceptedRatePlanDenormalizer.php @@ -32,7 +32,7 @@ class DeveloperAcceptedRatePlanDenormalizer extends AcceptedRatePlanDenormalizer /** * {@inheritdoc} */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { return parent::denormalize($data, $this->developerAcceptedRatePlanClass, $format, $context); } @@ -40,9 +40,9 @@ public function denormalize($data, $type, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { - if (parent::supportsDenormalization($data, $type, $format)) { + if (parent::supportsDenormalization($data, $type, $format, $context)) { return true; } diff --git a/src/Api/ApigeeX/Denormalizer/DeveloperBillingTypeDenormalizer.php b/src/Api/ApigeeX/Denormalizer/DeveloperBillingTypeDenormalizer.php index d8413468..4c3278f3 100644 --- a/src/Api/ApigeeX/Denormalizer/DeveloperBillingTypeDenormalizer.php +++ b/src/Api/ApigeeX/Denormalizer/DeveloperBillingTypeDenormalizer.php @@ -32,7 +32,7 @@ class DeveloperBillingTypeDenormalizer extends BillingTypeDenormalizer /** * {@inheritdoc} */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { return parent::denormalize($data, $this->developerBillinTypeClass, $format, $context); } @@ -40,9 +40,9 @@ public function denormalize($data, $type, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { - if (parent::supportsDenormalization($data, $type, $format)) { + if (parent::supportsDenormalization($data, $type, $format, $context)) { return true; } diff --git a/src/Api/ApigeeX/Denormalizer/PrepaidBalanceDenormalizer.php b/src/Api/ApigeeX/Denormalizer/PrepaidBalanceDenormalizer.php index c0c0970b..51f6d1f7 100755 --- a/src/Api/ApigeeX/Denormalizer/PrepaidBalanceDenormalizer.php +++ b/src/Api/ApigeeX/Denormalizer/PrepaidBalanceDenormalizer.php @@ -45,7 +45,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { // Do not apply this on array objects. ArrayDenormalizer takes care of them. if ('[]' === substr($type, -2)) { diff --git a/src/Api/ApigeeX/Denormalizer/RatePlanDenormalizer.php b/src/Api/ApigeeX/Denormalizer/RatePlanDenormalizer.php index 92b04d04..c2841060 100755 --- a/src/Api/ApigeeX/Denormalizer/RatePlanDenormalizer.php +++ b/src/Api/ApigeeX/Denormalizer/RatePlanDenormalizer.php @@ -54,7 +54,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory * @psalm-suppress PossiblyNullReference - Organization should not be null * here. */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { /** @var RatePlanInterface $entity */ $entity = parent::denormalize($data, $type, $format, $context); @@ -65,7 +65,7 @@ public function denormalize($data, $type, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { // Do not apply this on array objects. ArrayDenormalizer takes care of them. if ('[]' === substr($type, -2)) { diff --git a/src/Api/ApigeeX/Denormalizer/RatePlanDenormalizerFactory.php b/src/Api/ApigeeX/Denormalizer/RatePlanDenormalizerFactory.php index 8a07a7f3..d04aff8f 100755 --- a/src/Api/ApigeeX/Denormalizer/RatePlanDenormalizerFactory.php +++ b/src/Api/ApigeeX/Denormalizer/RatePlanDenormalizerFactory.php @@ -56,12 +56,12 @@ public function __construct(array $denormalizers = []) * @psalm-suppress InvalidNullableReturnType - There are going to be at * least one denormalizer always that can denormalize data here. */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { foreach ($this->denormalizers as $denormalizer) { // Return the result from the first denormalizer that can // denormalize this. - if ($denormalizer->supportsDenormalization($data, $type, $format)) { + if ($denormalizer->supportsDenormalization($data, $type, $format, $context)) { return $denormalizer->denormalize($data, $type, $format, $context); } } @@ -70,10 +70,10 @@ public function denormalize($data, $type, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { foreach ($this->denormalizers as $denormalizer) { - if ($denormalizer->supportsDenormalization($data, $type, $format)) { + if ($denormalizer->supportsDenormalization($data, $type, $format, $context)) { return true; } } diff --git a/src/Api/ApigeeX/Denormalizer/RatePlanRateDenormalizer.php b/src/Api/ApigeeX/Denormalizer/RatePlanRateDenormalizer.php index f69a268f..9c7fc655 100755 --- a/src/Api/ApigeeX/Denormalizer/RatePlanRateDenormalizer.php +++ b/src/Api/ApigeeX/Denormalizer/RatePlanRateDenormalizer.php @@ -33,7 +33,7 @@ class RatePlanRateDenormalizer extends ObjectDenormalizer /** * {@inheritdoc} */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { $denormalized = (array) $data; if (RatePlanRate::TYPE_REVSHARE === $data->type) { @@ -48,7 +48,7 @@ public function denormalize($data, $type, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { // Do not apply this on array objects. ArrayDenormalizer takes care of them. if ('[]' === substr($type, -2)) { diff --git a/src/Api/ApigeeX/Denormalizer/StandardRatePlanDenormalizer.php b/src/Api/ApigeeX/Denormalizer/StandardRatePlanDenormalizer.php index 6fbf0e3b..b5dd1475 100755 --- a/src/Api/ApigeeX/Denormalizer/StandardRatePlanDenormalizer.php +++ b/src/Api/ApigeeX/Denormalizer/StandardRatePlanDenormalizer.php @@ -41,7 +41,7 @@ class StandardRatePlanDenormalizer extends RatePlanDenormalizer /** * {@inheritdoc} */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { if (isset($data->parentRatePlan)) { return parent::denormalize($data, $this->standardRatePlanRevisionClass, $format, $context); @@ -53,14 +53,14 @@ public function denormalize($data, $type, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { // Do not apply this on array objects. ArrayDenormalizer takes care of them. if ('[]' === substr($type, -2)) { return false; } - if (parent::supportsDenormalization($data, $type, $format)) { + if (parent::supportsDenormalization($data, $type, $format, $context)) { // return RatePlanInterface::TYPE_STANDARD == $data->type; return RatePlanInterface::TYPE_STANDARD == 'STANDARD'; } diff --git a/src/Api/ApigeeX/Normalizer/AcceptedRatePlanNormalizer.php b/src/Api/ApigeeX/Normalizer/AcceptedRatePlanNormalizer.php index abe09791..724d6df9 100755 --- a/src/Api/ApigeeX/Normalizer/AcceptedRatePlanNormalizer.php +++ b/src/Api/ApigeeX/Normalizer/AcceptedRatePlanNormalizer.php @@ -44,7 +44,7 @@ public function normalize($object, $format = null, array $context = []): array|s /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof AcceptedRatePlanInterface; } diff --git a/src/Api/ApigeeX/Normalizer/ApiProductNormalizer.php b/src/Api/ApigeeX/Normalizer/ApiProductNormalizer.php index 4ab87a1d..3d8c28b5 100755 --- a/src/Api/ApigeeX/Normalizer/ApiProductNormalizer.php +++ b/src/Api/ApigeeX/Normalizer/ApiProductNormalizer.php @@ -58,7 +58,7 @@ public function normalize($object, $format = null, array $context = []): array|s /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof ApiProductInterface; } diff --git a/src/Api/ApigeeX/Normalizer/AppGroupMembershipNormalizer.php b/src/Api/ApigeeX/Normalizer/AppGroupMembershipNormalizer.php index 280a358a..c4f6a665 100644 --- a/src/Api/ApigeeX/Normalizer/AppGroupMembershipNormalizer.php +++ b/src/Api/ApigeeX/Normalizer/AppGroupMembershipNormalizer.php @@ -44,7 +44,7 @@ public function normalize($object, $format = null, array $context = []): array|s /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof AppGroupMembership; } diff --git a/src/Api/ApigeeX/Normalizer/AppNormalizer.php b/src/Api/ApigeeX/Normalizer/AppNormalizer.php index 8eb0b9e1..f4304e9e 100644 --- a/src/Api/ApigeeX/Normalizer/AppNormalizer.php +++ b/src/Api/ApigeeX/Normalizer/AppNormalizer.php @@ -30,7 +30,7 @@ class AppNormalizer extends ObjectNormalizer implements NormalizerInterface /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof AppInterface; } diff --git a/src/Api/ApigeeX/Normalizer/BillingTypeNormalizer.php b/src/Api/ApigeeX/Normalizer/BillingTypeNormalizer.php index 25a35d4f..469a9a62 100644 --- a/src/Api/ApigeeX/Normalizer/BillingTypeNormalizer.php +++ b/src/Api/ApigeeX/Normalizer/BillingTypeNormalizer.php @@ -41,7 +41,7 @@ public function normalize($object, $format = null, array $context = []): array|s /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof BillingTypeInterface; } diff --git a/src/Api/ApigeeX/Normalizer/PrepaidBalanceNormalizer.php b/src/Api/ApigeeX/Normalizer/PrepaidBalanceNormalizer.php index 6a9ee05e..090bae1b 100755 --- a/src/Api/ApigeeX/Normalizer/PrepaidBalanceNormalizer.php +++ b/src/Api/ApigeeX/Normalizer/PrepaidBalanceNormalizer.php @@ -45,7 +45,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory /** * {@inheritDoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof PrepaidBalanceInterface; } diff --git a/src/Api/ApigeeX/Normalizer/RatePlanNormalizer.php b/src/Api/ApigeeX/Normalizer/RatePlanNormalizer.php index b78d8268..1c5e40b9 100755 --- a/src/Api/ApigeeX/Normalizer/RatePlanNormalizer.php +++ b/src/Api/ApigeeX/Normalizer/RatePlanNormalizer.php @@ -70,7 +70,7 @@ public function normalize($object, $format = null, array $context = []): array|s /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof RatePlanInterface; } diff --git a/src/Api/ApigeeX/Normalizer/RatePlanNormalizerFactory.php b/src/Api/ApigeeX/Normalizer/RatePlanNormalizerFactory.php index 70730221..0d0b0a9e 100755 --- a/src/Api/ApigeeX/Normalizer/RatePlanNormalizerFactory.php +++ b/src/Api/ApigeeX/Normalizer/RatePlanNormalizerFactory.php @@ -70,10 +70,10 @@ public function normalize($object, $format = null, array $context = []): array|s /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { foreach ($this->normalizers as $denormalizer) { - if ($denormalizer->supportsNormalization($data, $format)) { + if ($denormalizer->supportsNormalization($data, $format, $context)) { return true; } } diff --git a/src/Api/ApigeeX/Normalizer/RatePlanRateNormalizer.php b/src/Api/ApigeeX/Normalizer/RatePlanRateNormalizer.php index d1214aa6..d5acc4fd 100755 --- a/src/Api/ApigeeX/Normalizer/RatePlanRateNormalizer.php +++ b/src/Api/ApigeeX/Normalizer/RatePlanRateNormalizer.php @@ -46,7 +46,7 @@ public function normalize($object, $format = null, array $context = []): array|s /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof RatePlanRate; } diff --git a/src/Api/ApigeeX/Normalizer/StandardRatePlanNormalizer.php b/src/Api/ApigeeX/Normalizer/StandardRatePlanNormalizer.php index b0874e41..236f5d41 100755 --- a/src/Api/ApigeeX/Normalizer/StandardRatePlanNormalizer.php +++ b/src/Api/ApigeeX/Normalizer/StandardRatePlanNormalizer.php @@ -41,7 +41,7 @@ public function normalize($object, $format = null, array $context = []): array|s /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof StandardRatePlanInterface; } diff --git a/src/Api/Management/Denormalizer/AppDenormalizer.php b/src/Api/Management/Denormalizer/AppDenormalizer.php index 8f7bd2dc..c57c77f0 100644 --- a/src/Api/Management/Denormalizer/AppDenormalizer.php +++ b/src/Api/Management/Denormalizer/AppDenormalizer.php @@ -46,7 +46,7 @@ class AppDenormalizer extends ObjectDenormalizer /** * {@inheritdoc} */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { if (isset($data->developerId)) { return parent::denormalize($data, $this->developerAppClass, $format, $context); @@ -61,7 +61,7 @@ public function denormalize($data, $type, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { // Do not apply this on array objects. ArrayDenormalizer takes care of them. if ('[]' === substr($type, -2)) { diff --git a/src/Api/Management/Denormalizer/CompanyMembershipDenormalizer.php b/src/Api/Management/Denormalizer/CompanyMembershipDenormalizer.php index bcd725ba..337d3d72 100755 --- a/src/Api/Management/Denormalizer/CompanyMembershipDenormalizer.php +++ b/src/Api/Management/Denormalizer/CompanyMembershipDenormalizer.php @@ -29,7 +29,7 @@ class CompanyMembershipDenormalizer implements DenormalizerInterface /** * {@inheritdoc} */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { $denormalized = []; // Ignore parent "developer" key. @@ -44,7 +44,7 @@ public function denormalize($data, $type, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { // Do not apply this on array objects. ArrayDenormalizer takes care of them. if ('[]' === substr($type, -2)) { diff --git a/src/Api/Management/Normalizer/AppCredentialNormalizer.php b/src/Api/Management/Normalizer/AppCredentialNormalizer.php index 21d88a4d..6d623ea4 100644 --- a/src/Api/Management/Normalizer/AppCredentialNormalizer.php +++ b/src/Api/Management/Normalizer/AppCredentialNormalizer.php @@ -30,7 +30,7 @@ class AppCredentialNormalizer extends ObjectNormalizer implements NormalizerInte /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof AppCredentialInterface; } diff --git a/src/Api/Management/Normalizer/AppNormalizer.php b/src/Api/Management/Normalizer/AppNormalizer.php index e94276cb..9f49cb57 100644 --- a/src/Api/Management/Normalizer/AppNormalizer.php +++ b/src/Api/Management/Normalizer/AppNormalizer.php @@ -30,7 +30,7 @@ class AppNormalizer extends ObjectNormalizer implements NormalizerInterface /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof AppInterface; } diff --git a/src/Api/Management/Normalizer/CompanyMembershipNormalizer.php b/src/Api/Management/Normalizer/CompanyMembershipNormalizer.php index 8e36875d..a1868d42 100644 --- a/src/Api/Management/Normalizer/CompanyMembershipNormalizer.php +++ b/src/Api/Management/Normalizer/CompanyMembershipNormalizer.php @@ -41,13 +41,13 @@ public function normalize($object, $format = null, array $context = []): array|s // convert to ArrayObject as symfony normalizer throws error for std object. // set ARRAY_AS_PROPS flag as we need entries to be accessed as properties. - return new \ArrayObject($normalized, \ArrayObject::ARRAY_AS_PROPS); + return new ArrayObject($normalized, ArrayObject::ARRAY_AS_PROPS); } /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof CompanyMembership; } diff --git a/src/Api/Management/Query/StatsQueryNormalizer.php b/src/Api/Management/Query/StatsQueryNormalizer.php index dc50bcd6..d1d1709c 100644 --- a/src/Api/Management/Query/StatsQueryNormalizer.php +++ b/src/Api/Management/Query/StatsQueryNormalizer.php @@ -92,7 +92,7 @@ public function normalize($object, $format = null, array $context = []): array|s /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof StatsQuery; } diff --git a/src/Api/Monetization/Denormalizer/AcceptedRatePlanDenormalizer.php b/src/Api/Monetization/Denormalizer/AcceptedRatePlanDenormalizer.php index 41bba56c..f20502a6 100644 --- a/src/Api/Monetization/Denormalizer/AcceptedRatePlanDenormalizer.php +++ b/src/Api/Monetization/Denormalizer/AcceptedRatePlanDenormalizer.php @@ -32,7 +32,7 @@ abstract class AcceptedRatePlanDenormalizer extends ObjectDenormalizer * @psalm-suppress PossiblyNullReference - getPackage() can only return * null when a rate plan is created. It does not return null here. */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { /** @var AcceptedRatePlanInterface $denormalized */ $denormalized = parent::denormalize($data, $type, $format, $context); @@ -45,7 +45,7 @@ public function denormalize($data, $type, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { // Do not apply this on array objects. ArrayDenormalizer takes care of them. if ('[]' === substr($type, -2)) { diff --git a/src/Api/Monetization/Denormalizer/AddressDenormalizer.php b/src/Api/Monetization/Denormalizer/AddressDenormalizer.php index 16e37ebd..ff01ca43 100644 --- a/src/Api/Monetization/Denormalizer/AddressDenormalizer.php +++ b/src/Api/Monetization/Denormalizer/AddressDenormalizer.php @@ -45,7 +45,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { // Do not apply this on array objects. ArrayDenormalizer takes care of them. if ('[]' === substr($type, -2)) { diff --git a/src/Api/Monetization/Denormalizer/ApiPackageDenormalizer.php b/src/Api/Monetization/Denormalizer/ApiPackageDenormalizer.php index 204a5f27..2eaa8ec6 100644 --- a/src/Api/Monetization/Denormalizer/ApiPackageDenormalizer.php +++ b/src/Api/Monetization/Denormalizer/ApiPackageDenormalizer.php @@ -45,7 +45,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { // Do not apply this on array objects. ArrayDenormalizer takes care of them. if ('[]' === substr($type, -2)) { diff --git a/src/Api/Monetization/Denormalizer/BalanceDenormalizer.php b/src/Api/Monetization/Denormalizer/BalanceDenormalizer.php index e2d705ee..c3dbae56 100644 --- a/src/Api/Monetization/Denormalizer/BalanceDenormalizer.php +++ b/src/Api/Monetization/Denormalizer/BalanceDenormalizer.php @@ -45,7 +45,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { // Do not apply this on array objects. ArrayDenormalizer takes care of them. if ('[]' === substr($type, -2)) { diff --git a/src/Api/Monetization/Denormalizer/CompanyAcceptedRatePlanDenormalizer.php b/src/Api/Monetization/Denormalizer/CompanyAcceptedRatePlanDenormalizer.php index 2b68ae3e..2516f237 100644 --- a/src/Api/Monetization/Denormalizer/CompanyAcceptedRatePlanDenormalizer.php +++ b/src/Api/Monetization/Denormalizer/CompanyAcceptedRatePlanDenormalizer.php @@ -51,7 +51,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory /** * {@inheritdoc} */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { return parent::denormalize($data, $this->companyAcceptedRatePlanClass, $format, $context); } @@ -59,9 +59,9 @@ public function denormalize($data, $type, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { - if (parent::supportsDenormalization($data, $type, $format)) { + if (parent::supportsDenormalization($data, $type, $format, $context)) { return $data->developer->isCompany; } diff --git a/src/Api/Monetization/Denormalizer/CompanyPaymentTransactionDenormalizer.php b/src/Api/Monetization/Denormalizer/CompanyPaymentTransactionDenormalizer.php index 8bc914ea..829b600b 100644 --- a/src/Api/Monetization/Denormalizer/CompanyPaymentTransactionDenormalizer.php +++ b/src/Api/Monetization/Denormalizer/CompanyPaymentTransactionDenormalizer.php @@ -51,7 +51,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory /** * {@inheritdoc} */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { return parent::denormalize($data, $this->companyPaymentTransactionClass, $format, $context); } @@ -59,9 +59,9 @@ public function denormalize($data, $type, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { - if (parent::supportsDenormalization($data, $type, $format)) { + if (parent::supportsDenormalization($data, $type, $format, $context)) { return $data->developer->isCompany; } diff --git a/src/Api/Monetization/Denormalizer/CompanyRatePlanDenormalizer.php b/src/Api/Monetization/Denormalizer/CompanyRatePlanDenormalizer.php index 55c1ea4c..bfb46031 100644 --- a/src/Api/Monetization/Denormalizer/CompanyRatePlanDenormalizer.php +++ b/src/Api/Monetization/Denormalizer/CompanyRatePlanDenormalizer.php @@ -56,7 +56,7 @@ public function __construct(?\Symfony\Component\Serializer\Mapping\Factory\Class /** * {@inheritdoc} */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { if (isset($data->parentRatePlan)) { return parent::denormalize($data, $this->companyRatePlanRevisionClass, $format, $context); @@ -68,14 +68,14 @@ public function denormalize($data, $type, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { // Do not apply this on array objects. ArrayDenormalizer takes care of them. if ('[]' === substr($type, -2)) { return false; } - if (parent::supportsDenormalization($data, $type, $format)) { + if (parent::supportsDenormalization($data, $type, $format, $context)) { return RatePlanInterface::TYPE_DEVELOPER == $data->type && $data->developer->isCompany; } diff --git a/src/Api/Monetization/Denormalizer/CompanyReportDefinitionDenormalizer.php b/src/Api/Monetization/Denormalizer/CompanyReportDefinitionDenormalizer.php index 000e7527..459053a4 100644 --- a/src/Api/Monetization/Denormalizer/CompanyReportDefinitionDenormalizer.php +++ b/src/Api/Monetization/Denormalizer/CompanyReportDefinitionDenormalizer.php @@ -51,7 +51,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory /** * {@inheritdoc} */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { return parent::denormalize($data, $this->companyReportDefinitionClass, $format, $context); } @@ -59,9 +59,9 @@ public function denormalize($data, $type, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { - if (parent::supportsDenormalization($data, $type, $format)) { + if (parent::supportsDenormalization($data, $type, $format, $context)) { // Non-developer specific reports API also returns the developer // property, but it is always NULL. return is_object($data->developer) && $data->developer->isCompany; diff --git a/src/Api/Monetization/Denormalizer/DateTimeZoneDenormalizer.php b/src/Api/Monetization/Denormalizer/DateTimeZoneDenormalizer.php index dd82d672..800845ff 100644 --- a/src/Api/Monetization/Denormalizer/DateTimeZoneDenormalizer.php +++ b/src/Api/Monetization/Denormalizer/DateTimeZoneDenormalizer.php @@ -28,7 +28,7 @@ class DateTimeZoneDenormalizer implements DenormalizerInterface /** * {@inheritdoc} */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { try { return new DateTimeZone($data); @@ -40,7 +40,7 @@ public function denormalize($data, $type, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { // Do not apply this on array objects. ArrayDenormalizer takes care of them. if ('[]' === substr($type, -2)) { diff --git a/src/Api/Monetization/Denormalizer/DeveloperAcceptedRatePlanDenormalizer.php b/src/Api/Monetization/Denormalizer/DeveloperAcceptedRatePlanDenormalizer.php index 5c3098ce..861b568f 100644 --- a/src/Api/Monetization/Denormalizer/DeveloperAcceptedRatePlanDenormalizer.php +++ b/src/Api/Monetization/Denormalizer/DeveloperAcceptedRatePlanDenormalizer.php @@ -32,7 +32,7 @@ class DeveloperAcceptedRatePlanDenormalizer extends AcceptedRatePlanDenormalizer /** * {@inheritdoc} */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { return parent::denormalize($data, $this->developerAcceptedRatePlanClass, $format, $context); } @@ -40,9 +40,9 @@ public function denormalize($data, $type, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { - if (parent::supportsDenormalization($data, $type, $format)) { + if (parent::supportsDenormalization($data, $type, $format, $context)) { return !$data->developer->isCompany; } diff --git a/src/Api/Monetization/Denormalizer/DeveloperCategoryRatePlanDenormalizer.php b/src/Api/Monetization/Denormalizer/DeveloperCategoryRatePlanDenormalizer.php index 9606cc2a..aae2de99 100644 --- a/src/Api/Monetization/Denormalizer/DeveloperCategoryRatePlanDenormalizer.php +++ b/src/Api/Monetization/Denormalizer/DeveloperCategoryRatePlanDenormalizer.php @@ -41,7 +41,7 @@ class DeveloperCategoryRatePlanDenormalizer extends RatePlanDenormalizer /** * {@inheritdoc} */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { if (isset($data->parentRatePlan)) { return parent::denormalize($data, $this->developerCategoryRatePlanRevisionClass, $format, $context); @@ -53,14 +53,14 @@ public function denormalize($data, $type, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { // Do not apply this on array objects. ArrayDenormalizer takes care of them. if ('[]' === substr($type, -2)) { return false; } - if (parent::supportsDenormalization($data, $type, $format)) { + if (parent::supportsDenormalization($data, $type, $format, $context)) { return RatePlanInterface::TYPE_DEVELOPER_CATEGORY == $data->type; } diff --git a/src/Api/Monetization/Denormalizer/DeveloperPaymentTransactionDenormalizer.php b/src/Api/Monetization/Denormalizer/DeveloperPaymentTransactionDenormalizer.php index d351ab06..005ca2fd 100644 --- a/src/Api/Monetization/Denormalizer/DeveloperPaymentTransactionDenormalizer.php +++ b/src/Api/Monetization/Denormalizer/DeveloperPaymentTransactionDenormalizer.php @@ -32,7 +32,7 @@ class DeveloperPaymentTransactionDenormalizer extends PaymentTransactionDenormal /** * {@inheritdoc} */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { return parent::denormalize($data, $this->developerPaymentTransactionClass, $format, $context); } @@ -40,9 +40,9 @@ public function denormalize($data, $type, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { - if (parent::supportsDenormalization($data, $type, $format)) { + if (parent::supportsDenormalization($data, $type, $format, $context)) { return !$data->developer->isCompany; } diff --git a/src/Api/Monetization/Denormalizer/DeveloperRatePlanDenormalizer.php b/src/Api/Monetization/Denormalizer/DeveloperRatePlanDenormalizer.php index b7fd92dd..035aa394 100644 --- a/src/Api/Monetization/Denormalizer/DeveloperRatePlanDenormalizer.php +++ b/src/Api/Monetization/Denormalizer/DeveloperRatePlanDenormalizer.php @@ -41,7 +41,7 @@ class DeveloperRatePlanDenormalizer extends RatePlanDenormalizer /** * {@inheritdoc} */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { if (isset($data->parentRatePlan)) { return parent::denormalize($data, $this->developerRatePlanRevisionClass, $format, $context); @@ -53,14 +53,14 @@ public function denormalize($data, $type, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { // Do not apply this on array objects. ArrayDenormalizer takes care of them. if ('[]' === substr($type, -2)) { return false; } - if (parent::supportsDenormalization($data, $type, $format)) { + if (parent::supportsDenormalization($data, $type, $format, $context)) { return RatePlanInterface::TYPE_DEVELOPER == $data->type && empty($data->developer->isCompany); } diff --git a/src/Api/Monetization/Denormalizer/DeveloperReportDefinitionDenormalizer.php b/src/Api/Monetization/Denormalizer/DeveloperReportDefinitionDenormalizer.php index f003149f..26d4d687 100644 --- a/src/Api/Monetization/Denormalizer/DeveloperReportDefinitionDenormalizer.php +++ b/src/Api/Monetization/Denormalizer/DeveloperReportDefinitionDenormalizer.php @@ -32,7 +32,7 @@ class DeveloperReportDefinitionDenormalizer extends ReportDefinitionDenormalizer /** * {@inheritdoc} */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { return parent::denormalize($data, $this->developerReportDefinitionClass, $format, $context); } @@ -40,9 +40,9 @@ public function denormalize($data, $type, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { - if (parent::supportsDenormalization($data, $type, $format)) { + if (parent::supportsDenormalization($data, $type, $format, $context)) { // Non-developer specific reports API also returns the developer // property, but it is always NULL. return is_object($data->developer) && !$data->developer->isCompany; diff --git a/src/Api/Monetization/Denormalizer/LegalEntityDenormalizer.php b/src/Api/Monetization/Denormalizer/LegalEntityDenormalizer.php index 294f4c44..b60682b8 100644 --- a/src/Api/Monetization/Denormalizer/LegalEntityDenormalizer.php +++ b/src/Api/Monetization/Denormalizer/LegalEntityDenormalizer.php @@ -64,7 +64,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory /** * {@inheritdoc} */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { if ($data->isCompany) { return parent::denormalize($data, $this->companyClass, $format, $context); @@ -76,7 +76,7 @@ public function denormalize($data, $type, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { // Do not apply this on array objects. ArrayDenormalizer takes care of them. if ('[]' === substr($type, -2)) { diff --git a/src/Api/Monetization/Denormalizer/OrganizationProfileDenormalizer.php b/src/Api/Monetization/Denormalizer/OrganizationProfileDenormalizer.php index de1da2f6..49ff8e46 100644 --- a/src/Api/Monetization/Denormalizer/OrganizationProfileDenormalizer.php +++ b/src/Api/Monetization/Denormalizer/OrganizationProfileDenormalizer.php @@ -45,7 +45,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { // Do not apply this on array objects. ArrayDenormalizer takes care of them. if ('[]' === substr($type, -2)) { diff --git a/src/Api/Monetization/Denormalizer/PaymentTransactionDenormalizer.php b/src/Api/Monetization/Denormalizer/PaymentTransactionDenormalizer.php index 65fb8b58..83ff6f37 100644 --- a/src/Api/Monetization/Denormalizer/PaymentTransactionDenormalizer.php +++ b/src/Api/Monetization/Denormalizer/PaymentTransactionDenormalizer.php @@ -45,7 +45,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { // Do not apply this on array objects. ArrayDenormalizer takes care of them. if ('[]' === substr($type, -2)) { diff --git a/src/Api/Monetization/Denormalizer/PrepaidBalanceDenormalizer.php b/src/Api/Monetization/Denormalizer/PrepaidBalanceDenormalizer.php index 26ac3219..17a5a0de 100644 --- a/src/Api/Monetization/Denormalizer/PrepaidBalanceDenormalizer.php +++ b/src/Api/Monetization/Denormalizer/PrepaidBalanceDenormalizer.php @@ -45,7 +45,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { // Do not apply this on array objects. ArrayDenormalizer takes care of them. if ('[]' === substr($type, -2)) { diff --git a/src/Api/Monetization/Denormalizer/RatePlanDenormalizer.php b/src/Api/Monetization/Denormalizer/RatePlanDenormalizer.php index 5dd46192..ac4041eb 100644 --- a/src/Api/Monetization/Denormalizer/RatePlanDenormalizer.php +++ b/src/Api/Monetization/Denormalizer/RatePlanDenormalizer.php @@ -54,7 +54,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory * @psalm-suppress PossiblyNullReference - Organization should not be null * here. */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { /** @var RatePlanInterface $entity */ $entity = parent::denormalize($data, $type, $format, $context); @@ -67,7 +67,7 @@ public function denormalize($data, $type, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { // Do not apply this on array objects. ArrayDenormalizer takes care of them. if ('[]' === substr($type, -2)) { diff --git a/src/Api/Monetization/Denormalizer/RatePlanDenormalizerFactory.php b/src/Api/Monetization/Denormalizer/RatePlanDenormalizerFactory.php index d3450368..8acec0c2 100644 --- a/src/Api/Monetization/Denormalizer/RatePlanDenormalizerFactory.php +++ b/src/Api/Monetization/Denormalizer/RatePlanDenormalizerFactory.php @@ -53,12 +53,12 @@ public function __construct(array $denormalizers = []) * @psalm-suppress InvalidNullableReturnType - There are going to be at * least one denormalizer always that can denormalize data here. */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { foreach ($this->denormalizers as $denormalizer) { // Return the result from the first denormalizer that can // denormalize this. - if ($denormalizer->supportsDenormalization($data, $type, $format)) { + if ($denormalizer->supportsDenormalization($data, $type, $format, $context)) { return $denormalizer->denormalize($data, $type, $format, $context); } } @@ -67,10 +67,10 @@ public function denormalize($data, $type, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { foreach ($this->denormalizers as $denormalizer) { - if ($denormalizer->supportsDenormalization($data, $type, $format)) { + if ($denormalizer->supportsDenormalization($data, $type, $format, $context)) { return true; } } diff --git a/src/Api/Monetization/Denormalizer/RatePlanRateDenormalizer.php b/src/Api/Monetization/Denormalizer/RatePlanRateDenormalizer.php index 6642040f..fd41c674 100644 --- a/src/Api/Monetization/Denormalizer/RatePlanRateDenormalizer.php +++ b/src/Api/Monetization/Denormalizer/RatePlanRateDenormalizer.php @@ -33,7 +33,7 @@ class RatePlanRateDenormalizer extends ObjectDenormalizer /** * {@inheritdoc} */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { $denormalized = (array) $data; if (RatePlanRate::TYPE_REVSHARE === $data->type) { @@ -48,7 +48,7 @@ public function denormalize($data, $type, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { // Do not apply this on array objects. ArrayDenormalizer takes care of them. if ('[]' === substr($type, -2)) { diff --git a/src/Api/Monetization/Denormalizer/ReportCriteriaDenormalizer.php b/src/Api/Monetization/Denormalizer/ReportCriteriaDenormalizer.php index 13d6e9ce..c2a7e822 100644 --- a/src/Api/Monetization/Denormalizer/ReportCriteriaDenormalizer.php +++ b/src/Api/Monetization/Denormalizer/ReportCriteriaDenormalizer.php @@ -61,7 +61,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory * * @psalm-suppress PossiblyInvalidArgument We are sure of the return type of denormalize(). */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { // This is what is in the type-hint on the $criteria property of the // ReportDefinition object. @@ -128,7 +128,7 @@ public function denormalize($data, $type, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { // Do not apply this on array objects. ArrayDenormalizer takes care of them. if ('[]' === substr($type, -2)) { diff --git a/src/Api/Monetization/Denormalizer/ReportDefinitionDenormalizer.php b/src/Api/Monetization/Denormalizer/ReportDefinitionDenormalizer.php index 59a40c6d..d7f40bd9 100644 --- a/src/Api/Monetization/Denormalizer/ReportDefinitionDenormalizer.php +++ b/src/Api/Monetization/Denormalizer/ReportDefinitionDenormalizer.php @@ -45,7 +45,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { // Do not apply this on array objects. ArrayDenormalizer takes care of them. if ('[]' === substr($type, -2)) { diff --git a/src/Api/Monetization/Denormalizer/StandardRatePlanDenormalizer.php b/src/Api/Monetization/Denormalizer/StandardRatePlanDenormalizer.php index dbd1da96..7ca38279 100644 --- a/src/Api/Monetization/Denormalizer/StandardRatePlanDenormalizer.php +++ b/src/Api/Monetization/Denormalizer/StandardRatePlanDenormalizer.php @@ -41,7 +41,7 @@ class StandardRatePlanDenormalizer extends RatePlanDenormalizer /** * {@inheritdoc} */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { if (isset($data->parentRatePlan)) { return parent::denormalize($data, $this->standardRatePlanRevisionClass, $format, $context); @@ -53,14 +53,14 @@ public function denormalize($data, $type, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { // Do not apply this on array objects. ArrayDenormalizer takes care of them. if ('[]' === substr($type, -2)) { return false; } - if (parent::supportsDenormalization($data, $type, $format)) { + if (parent::supportsDenormalization($data, $type, $format, $context)) { return RatePlanInterface::TYPE_STANDARD == $data->type; } diff --git a/src/Api/Monetization/Denormalizer/SupportedCurrencyDenormalizer.php b/src/Api/Monetization/Denormalizer/SupportedCurrencyDenormalizer.php index 0540a2c2..66d1510e 100644 --- a/src/Api/Monetization/Denormalizer/SupportedCurrencyDenormalizer.php +++ b/src/Api/Monetization/Denormalizer/SupportedCurrencyDenormalizer.php @@ -45,7 +45,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { // Do not apply this on array objects. ArrayDenormalizer takes care of them. if ('[]' === substr($type, -2)) { diff --git a/src/Api/Monetization/Denormalizer/TermsAndConditionsDenormalizer.php b/src/Api/Monetization/Denormalizer/TermsAndConditionsDenormalizer.php index 0963f464..df931885 100644 --- a/src/Api/Monetization/Denormalizer/TermsAndConditionsDenormalizer.php +++ b/src/Api/Monetization/Denormalizer/TermsAndConditionsDenormalizer.php @@ -51,7 +51,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory * @psalm-suppress PossiblyNullReference - Organization should not be null * here. */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { /** @var TermsAndConditionsInterface $entity */ $entity = parent::denormalize($data, $type, $format, $context); @@ -64,7 +64,7 @@ public function denormalize($data, $type, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { // Do not apply this on array objects. ArrayDenormalizer takes care of them. if ('[]' === substr($type, -2)) { diff --git a/src/Api/Monetization/Normalizer/AcceptedRatePlanNormalizer.php b/src/Api/Monetization/Normalizer/AcceptedRatePlanNormalizer.php index 170a79e4..67e7bc9b 100644 --- a/src/Api/Monetization/Normalizer/AcceptedRatePlanNormalizer.php +++ b/src/Api/Monetization/Normalizer/AcceptedRatePlanNormalizer.php @@ -44,7 +44,7 @@ public function normalize($object, $format = null, array $context = []): array|s /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof AcceptedRatePlanInterface; } diff --git a/src/Api/Monetization/Normalizer/AddressNormalizer.php b/src/Api/Monetization/Normalizer/AddressNormalizer.php index b2f94129..d72aa2cb 100644 --- a/src/Api/Monetization/Normalizer/AddressNormalizer.php +++ b/src/Api/Monetization/Normalizer/AddressNormalizer.php @@ -45,7 +45,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof Address; } diff --git a/src/Api/Monetization/Normalizer/ApiPackageNormalizer.php b/src/Api/Monetization/Normalizer/ApiPackageNormalizer.php index 022922ee..5f4e9d88 100644 --- a/src/Api/Monetization/Normalizer/ApiPackageNormalizer.php +++ b/src/Api/Monetization/Normalizer/ApiPackageNormalizer.php @@ -63,7 +63,7 @@ public function normalize($object, $format = null, array $context = []): array|s /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof ApiPackageInterface; } diff --git a/src/Api/Monetization/Normalizer/BalanceNormalizer.php b/src/Api/Monetization/Normalizer/BalanceNormalizer.php index e467b88b..58b91b9f 100644 --- a/src/Api/Monetization/Normalizer/BalanceNormalizer.php +++ b/src/Api/Monetization/Normalizer/BalanceNormalizer.php @@ -44,7 +44,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof BalanceInterface; } diff --git a/src/Api/Monetization/Normalizer/CompanyAcceptedRatePlanNormalizer.php b/src/Api/Monetization/Normalizer/CompanyAcceptedRatePlanNormalizer.php index 98341571..81a5044a 100644 --- a/src/Api/Monetization/Normalizer/CompanyAcceptedRatePlanNormalizer.php +++ b/src/Api/Monetization/Normalizer/CompanyAcceptedRatePlanNormalizer.php @@ -44,7 +44,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof CompanyAcceptedRatePlanInterface; } diff --git a/src/Api/Monetization/Normalizer/CompanyPaymentTransactionNormalizer.php b/src/Api/Monetization/Normalizer/CompanyPaymentTransactionNormalizer.php index 1a3f9577..84d8d0d4 100644 --- a/src/Api/Monetization/Normalizer/CompanyPaymentTransactionNormalizer.php +++ b/src/Api/Monetization/Normalizer/CompanyPaymentTransactionNormalizer.php @@ -59,7 +59,7 @@ public function normalize($object, $format = null, array $context = []): array|s /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof CompanyPaymentTransaction; } diff --git a/src/Api/Monetization/Normalizer/CompanyRatePlanNormalizer.php b/src/Api/Monetization/Normalizer/CompanyRatePlanNormalizer.php index 2851b632..84cf04c4 100644 --- a/src/Api/Monetization/Normalizer/CompanyRatePlanNormalizer.php +++ b/src/Api/Monetization/Normalizer/CompanyRatePlanNormalizer.php @@ -44,7 +44,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof CompanyRatePlanInterface; } diff --git a/src/Api/Monetization/Normalizer/CompanyReportDefinitionNormalizer.php b/src/Api/Monetization/Normalizer/CompanyReportDefinitionNormalizer.php index 22974aea..172fb5dc 100644 --- a/src/Api/Monetization/Normalizer/CompanyReportDefinitionNormalizer.php +++ b/src/Api/Monetization/Normalizer/CompanyReportDefinitionNormalizer.php @@ -44,7 +44,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof CompanyReportDefinitionInterface; } diff --git a/src/Api/Monetization/Normalizer/DateTimeZoneNormalizer.php b/src/Api/Monetization/Normalizer/DateTimeZoneNormalizer.php index 38cef829..c32d078b 100644 --- a/src/Api/Monetization/Normalizer/DateTimeZoneNormalizer.php +++ b/src/Api/Monetization/Normalizer/DateTimeZoneNormalizer.php @@ -34,7 +34,7 @@ public function normalize($object, $format = null, array $context = []): array|s /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof DateTimeZone; } diff --git a/src/Api/Monetization/Normalizer/DeveloperCategoryRatePlanNormalizer.php b/src/Api/Monetization/Normalizer/DeveloperCategoryRatePlanNormalizer.php index 9f8788a6..6d6c3919 100644 --- a/src/Api/Monetization/Normalizer/DeveloperCategoryRatePlanNormalizer.php +++ b/src/Api/Monetization/Normalizer/DeveloperCategoryRatePlanNormalizer.php @@ -41,7 +41,7 @@ public function normalize($object, $format = null, array $context = []): array|s /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof DeveloperCategoryRatePlanInterface; } diff --git a/src/Api/Monetization/Normalizer/DeveloperPaymentTransactionNormalizer.php b/src/Api/Monetization/Normalizer/DeveloperPaymentTransactionNormalizer.php index 139c6e38..935911a5 100644 --- a/src/Api/Monetization/Normalizer/DeveloperPaymentTransactionNormalizer.php +++ b/src/Api/Monetization/Normalizer/DeveloperPaymentTransactionNormalizer.php @@ -40,7 +40,7 @@ public function normalize($object, $format = null, array $context = []): array|s /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof DeveloperPaymentTransaction; } diff --git a/src/Api/Monetization/Normalizer/DeveloperRatePlanNormalizer.php b/src/Api/Monetization/Normalizer/DeveloperRatePlanNormalizer.php index 1b9a3f85..49b9fa1d 100644 --- a/src/Api/Monetization/Normalizer/DeveloperRatePlanNormalizer.php +++ b/src/Api/Monetization/Normalizer/DeveloperRatePlanNormalizer.php @@ -25,7 +25,7 @@ class DeveloperRatePlanNormalizer extends LegalEntityRatePlanNormalizer /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof DeveloperRatePlanInterface; } diff --git a/src/Api/Monetization/Normalizer/DeveloperReportDefinitionNormalizer.php b/src/Api/Monetization/Normalizer/DeveloperReportDefinitionNormalizer.php index 9e804d59..6b12fb43 100644 --- a/src/Api/Monetization/Normalizer/DeveloperReportDefinitionNormalizer.php +++ b/src/Api/Monetization/Normalizer/DeveloperReportDefinitionNormalizer.php @@ -25,7 +25,7 @@ class DeveloperReportDefinitionNormalizer extends LegalEntityReportDefinitionNor /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof DeveloperReportDefinitionInterface; } diff --git a/src/Api/Monetization/Normalizer/LegalEntityNormalizer.php b/src/Api/Monetization/Normalizer/LegalEntityNormalizer.php index 70fb383c..74729097 100644 --- a/src/Api/Monetization/Normalizer/LegalEntityNormalizer.php +++ b/src/Api/Monetization/Normalizer/LegalEntityNormalizer.php @@ -66,7 +66,7 @@ public function normalize($object, $format = null, array $context = []): array|s /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof LegalEntityInterface; } diff --git a/src/Api/Monetization/Normalizer/LegalEntityReportDefinitionNormalizer.php b/src/Api/Monetization/Normalizer/LegalEntityReportDefinitionNormalizer.php index bcd7e489..ebc5da08 100644 --- a/src/Api/Monetization/Normalizer/LegalEntityReportDefinitionNormalizer.php +++ b/src/Api/Monetization/Normalizer/LegalEntityReportDefinitionNormalizer.php @@ -18,7 +18,6 @@ namespace Apigee\Edge\Api\Monetization\Normalizer; - abstract class LegalEntityReportDefinitionNormalizer extends ReportDefinitionNormalizer { /** diff --git a/src/Api/Monetization/Normalizer/OrganizationProfileNormalizer.php b/src/Api/Monetization/Normalizer/OrganizationProfileNormalizer.php index fc4d9448..e836fe33 100644 --- a/src/Api/Monetization/Normalizer/OrganizationProfileNormalizer.php +++ b/src/Api/Monetization/Normalizer/OrganizationProfileNormalizer.php @@ -44,7 +44,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof OrganizationProfileInterface; } diff --git a/src/Api/Monetization/Normalizer/PaymentTransactionNormalizer.php b/src/Api/Monetization/Normalizer/PaymentTransactionNormalizer.php index 0c0e9826..22bd6bed 100644 --- a/src/Api/Monetization/Normalizer/PaymentTransactionNormalizer.php +++ b/src/Api/Monetization/Normalizer/PaymentTransactionNormalizer.php @@ -45,7 +45,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof PaymentTransaction; } diff --git a/src/Api/Monetization/Normalizer/PrepaidBalanceNormalizer.php b/src/Api/Monetization/Normalizer/PrepaidBalanceNormalizer.php index 7cb321e9..ca951e84 100644 --- a/src/Api/Monetization/Normalizer/PrepaidBalanceNormalizer.php +++ b/src/Api/Monetization/Normalizer/PrepaidBalanceNormalizer.php @@ -44,7 +44,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof PrepaidBalanceInterface; } diff --git a/src/Api/Monetization/Normalizer/RatePlanNormalizer.php b/src/Api/Monetization/Normalizer/RatePlanNormalizer.php index e4d8a78c..322f9171 100644 --- a/src/Api/Monetization/Normalizer/RatePlanNormalizer.php +++ b/src/Api/Monetization/Normalizer/RatePlanNormalizer.php @@ -75,7 +75,7 @@ public function normalize($object, $format = null, array $context = []): array|s /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof RatePlanInterface; } diff --git a/src/Api/Monetization/Normalizer/RatePlanNormalizerFactory.php b/src/Api/Monetization/Normalizer/RatePlanNormalizerFactory.php index b62fc8bb..91f73c4b 100644 --- a/src/Api/Monetization/Normalizer/RatePlanNormalizerFactory.php +++ b/src/Api/Monetization/Normalizer/RatePlanNormalizerFactory.php @@ -67,10 +67,10 @@ public function normalize($object, $format = null, array $context = []): array|s /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { foreach ($this->normalizers as $denormalizer) { - if ($denormalizer->supportsNormalization($data, $format)) { + if ($denormalizer->supportsNormalization($data, $format, $context)) { return true; } } diff --git a/src/Api/Monetization/Normalizer/RatePlanRateNormalizer.php b/src/Api/Monetization/Normalizer/RatePlanRateNormalizer.php index ced20de3..6a7bad08 100644 --- a/src/Api/Monetization/Normalizer/RatePlanRateNormalizer.php +++ b/src/Api/Monetization/Normalizer/RatePlanRateNormalizer.php @@ -46,7 +46,7 @@ public function normalize($object, $format = null, array $context = []): array|s /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof RatePlanRate; } diff --git a/src/Api/Monetization/Normalizer/ReportCriteriaNormalizer.php b/src/Api/Monetization/Normalizer/ReportCriteriaNormalizer.php index 7776ce09..1c48622d 100644 --- a/src/Api/Monetization/Normalizer/ReportCriteriaNormalizer.php +++ b/src/Api/Monetization/Normalizer/ReportCriteriaNormalizer.php @@ -95,7 +95,7 @@ public function normalize($object, $format = null, array $context = []): array|s /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof AbstractCriteria; } diff --git a/src/Api/Monetization/Normalizer/ReportDefinitionNormalizer.php b/src/Api/Monetization/Normalizer/ReportDefinitionNormalizer.php index f49affe1..a2599615 100644 --- a/src/Api/Monetization/Normalizer/ReportDefinitionNormalizer.php +++ b/src/Api/Monetization/Normalizer/ReportDefinitionNormalizer.php @@ -67,7 +67,7 @@ public function normalize($object, $format = null, array $context = []): array|s /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof ReportDefinitionInterface; } diff --git a/src/Api/Monetization/Normalizer/StandardRatePlanNormalizer.php b/src/Api/Monetization/Normalizer/StandardRatePlanNormalizer.php index a6f17a58..2c089829 100644 --- a/src/Api/Monetization/Normalizer/StandardRatePlanNormalizer.php +++ b/src/Api/Monetization/Normalizer/StandardRatePlanNormalizer.php @@ -41,7 +41,7 @@ public function normalize($object, $format = null, array $context = []): array|s /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof StandardRatePlanInterface; } diff --git a/src/Api/Monetization/Normalizer/SupportedCurrencyNormalizer.php b/src/Api/Monetization/Normalizer/SupportedCurrencyNormalizer.php index d2239970..f4de7b0f 100644 --- a/src/Api/Monetization/Normalizer/SupportedCurrencyNormalizer.php +++ b/src/Api/Monetization/Normalizer/SupportedCurrencyNormalizer.php @@ -44,7 +44,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof SupportedCurrencyInterface; } diff --git a/src/Api/Monetization/Normalizer/TermsAndConditionsNormalizer.php b/src/Api/Monetization/Normalizer/TermsAndConditionsNormalizer.php index 70117e1f..4d9b0517 100644 --- a/src/Api/Monetization/Normalizer/TermsAndConditionsNormalizer.php +++ b/src/Api/Monetization/Normalizer/TermsAndConditionsNormalizer.php @@ -72,7 +72,7 @@ public function normalize($object, $format = null, array $context = []): array|s /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof TermsAndConditionsInterface; } diff --git a/src/Api/Monetization/Serializer/ReportDefinitionSerializer.php b/src/Api/Monetization/Serializer/ReportDefinitionSerializer.php index 6826ade0..4f3270de 100644 --- a/src/Api/Monetization/Serializer/ReportDefinitionSerializer.php +++ b/src/Api/Monetization/Serializer/ReportDefinitionSerializer.php @@ -85,7 +85,7 @@ public function deserialize($data, $type, $format, array $context = []): mixed /** * {@inheritdoc} */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { $this->addReportDefinitionTypeToContext($data, $context); diff --git a/src/Denormalizer/AttributesPropertyDenormalizer.php b/src/Denormalizer/AttributesPropertyDenormalizer.php index 58f25fac..22e8dd05 100644 --- a/src/Denormalizer/AttributesPropertyDenormalizer.php +++ b/src/Denormalizer/AttributesPropertyDenormalizer.php @@ -28,7 +28,7 @@ class AttributesPropertyDenormalizer extends KeyValueMapDenormalizer /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { // Do not apply this on array objects. ArrayDenormalizer takes care of them. if ('[]' === substr($type, -2)) { @@ -48,7 +48,7 @@ public function supportsDenormalization($data, $type, $format = null): bool * * {@inheritdoc} */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { $flatten = []; foreach ($data as $key => $item) { diff --git a/src/Denormalizer/CredentialProductDenormalizer.php b/src/Denormalizer/CredentialProductDenormalizer.php index 9feb5177..98dde469 100644 --- a/src/Denormalizer/CredentialProductDenormalizer.php +++ b/src/Denormalizer/CredentialProductDenormalizer.php @@ -30,7 +30,7 @@ class CredentialProductDenormalizer implements DenormalizerInterface /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { // Do not apply this on array objects. ArrayDenormalizer takes care of them. if ('[]' === substr($type, -2)) { @@ -43,7 +43,7 @@ public function supportsDenormalization($data, $type, $format = null): bool /** * {@inheritdoc} */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { return new CredentialProduct($data->apiproduct, $data->status); } diff --git a/src/Denormalizer/EdgeDateDenormalizer.php b/src/Denormalizer/EdgeDateDenormalizer.php index 0fdd0af7..23719461 100644 --- a/src/Denormalizer/EdgeDateDenormalizer.php +++ b/src/Denormalizer/EdgeDateDenormalizer.php @@ -55,7 +55,7 @@ public function __construct() * @psalm-suppress ImplementedReturnTypeMismatch - We have to return null, * even if it not officially supported by the overridden class. */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { // Handle -1 in expiresAt property of AppCredential. if ($data < 0) { @@ -73,7 +73,7 @@ public function denormalize($data, $type, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return isset(self::$supportedTypes[$type]); } diff --git a/src/Denormalizer/KeyValueMapDenormalizer.php b/src/Denormalizer/KeyValueMapDenormalizer.php index 411135ea..5ea9c20a 100644 --- a/src/Denormalizer/KeyValueMapDenormalizer.php +++ b/src/Denormalizer/KeyValueMapDenormalizer.php @@ -29,7 +29,7 @@ class KeyValueMapDenormalizer implements DenormalizerInterface /** * {@inheritdoc} */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { return new $type($data); } @@ -37,7 +37,7 @@ public function denormalize($data, $type, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { // Do not apply this on array objects. ArrayDenormalizer takes care of them. if ('[]' === substr($type, -2)) { diff --git a/src/Denormalizer/ObjectDenormalizer.php b/src/Denormalizer/ObjectDenormalizer.php index 2ba8ebe9..3c6c8c42 100644 --- a/src/Denormalizer/ObjectDenormalizer.php +++ b/src/Denormalizer/ObjectDenormalizer.php @@ -89,7 +89,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory /** * {@inheritdoc} */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { // The original input should not be altered. if (is_object($data)) { @@ -113,7 +113,7 @@ public function denormalize($data, $type, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { if ('[]' === substr($type, -2)) { return false; @@ -122,7 +122,7 @@ public function supportsDenormalization($data, $type, $format = null): bool // Enforce the only supported format if format is null. $format = $format ?? $this->format; - return $format === $this->format && $this->objectNormalizer->supportsDenormalization($data, $type, $format); + return $format === $this->format && $this->objectNormalizer->supportsDenormalization($data, $type, $format, $context); } /** diff --git a/src/Denormalizer/PropertiesPropertyDenormalizer.php b/src/Denormalizer/PropertiesPropertyDenormalizer.php index 9682d269..fd13d21b 100644 --- a/src/Denormalizer/PropertiesPropertyDenormalizer.php +++ b/src/Denormalizer/PropertiesPropertyDenormalizer.php @@ -28,7 +28,7 @@ class PropertiesPropertyDenormalizer extends KeyValueMapDenormalizer /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { // Do not apply this on array objects. ArrayDenormalizer takes care of them. if ('[]' === substr($type, -2)) { @@ -41,7 +41,7 @@ public function supportsDenormalization($data, $type, $format = null): bool /** * {@inheritdoc} */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { if (is_object($data) && property_exists($data, 'property') && is_array($data->property)) { $flatten = []; diff --git a/src/Normalizer/CredentialProductNormalizer.php b/src/Normalizer/CredentialProductNormalizer.php index 3e43bf23..f18710b4 100644 --- a/src/Normalizer/CredentialProductNormalizer.php +++ b/src/Normalizer/CredentialProductNormalizer.php @@ -42,13 +42,13 @@ public function normalize($object, $format = null, array $context = []): array|s // Need to convert to ArrayObject as symfony normalizer throws error for std object. // Need to set ARRAY_AS_PROPS flag as we need Entries to be accessed as properties. - return new \ArrayObject($asObject, \ArrayObject::ARRAY_AS_PROPS); + return new ArrayObject($asObject, ArrayObject::ARRAY_AS_PROPS); } /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof CredentialProductInterface; } diff --git a/src/Normalizer/EdgeDateNormalizer.php b/src/Normalizer/EdgeDateNormalizer.php index f63d7af6..fe21719b 100644 --- a/src/Normalizer/EdgeDateNormalizer.php +++ b/src/Normalizer/EdgeDateNormalizer.php @@ -26,7 +26,7 @@ class EdgeDateNormalizer implements NormalizerInterface /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof DateTimeInterface; } diff --git a/src/Normalizer/KeyValueMapNormalizer.php b/src/Normalizer/KeyValueMapNormalizer.php index 1f7e0e5b..41f37c9e 100644 --- a/src/Normalizer/KeyValueMapNormalizer.php +++ b/src/Normalizer/KeyValueMapNormalizer.php @@ -42,7 +42,7 @@ public function normalize($object, $format = null, array $context = []): array|s /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof KeyValueMapInterface; } diff --git a/src/Normalizer/ObjectNormalizer.php b/src/Normalizer/ObjectNormalizer.php index 666690f6..18aa1dec 100644 --- a/src/Normalizer/ObjectNormalizer.php +++ b/src/Normalizer/ObjectNormalizer.php @@ -109,12 +109,12 @@ public function normalize($object, $format = null, array $context = []): array|s /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { // Enforce the only supported format if format is null. $format = $format ?? $this->format; - return $format === $this->format && $this->objectNormalizer->supportsNormalization($data, $format); + return $format === $this->format && $this->objectNormalizer->supportsNormalization($data, $format, $context); } /** @@ -129,10 +129,10 @@ public function setSerializer(SerializerInterface $serializer): void /** * {@inheritDoc} */ - public function convertToArrayObject($normalized, $array_as_props = \ArrayObject::ARRAY_AS_PROPS) + public function convertToArrayObject($normalized, $array_as_props = ArrayObject::ARRAY_AS_PROPS) { // default set ARRAY_AS_PROPS flag as we need entries to be accessed as properties. - return new \ArrayObject($normalized, $array_as_props); + return new ArrayObject($normalized, $array_as_props); } /** diff --git a/src/Normalizer/PropertiesPropertyNormalizer.php b/src/Normalizer/PropertiesPropertyNormalizer.php index eb66bbd9..1b3e56dd 100644 --- a/src/Normalizer/PropertiesPropertyNormalizer.php +++ b/src/Normalizer/PropertiesPropertyNormalizer.php @@ -41,13 +41,13 @@ public function normalize($object, $format = null, array $context = []): array|s // convert to ArrayObject as symfony normalizer throws error for std object. // set ARRAY_AS_PROPS flag as we need entries to be accessed as properties. - return new \ArrayObject($return, \ArrayObject::ARRAY_AS_PROPS); + return new ArrayObject($return, ArrayObject::ARRAY_AS_PROPS); } /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return $data instanceof PropertiesProperty; } diff --git a/src/Serializer/EntitySerializer.php b/src/Serializer/EntitySerializer.php index 2345386b..bf03a57d 100755 --- a/src/Serializer/EntitySerializer.php +++ b/src/Serializer/EntitySerializer.php @@ -74,7 +74,7 @@ public function __construct(array $normalizers = []) /** * {@inheritdoc} */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize($data, $type, $format = null, array $context = []): mixed { return $this->serializer->denormalize($data, $type, $format, $context); } @@ -82,9 +82,9 @@ public function denormalize($data, $type, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { - return $this->format === $format && $this->serializer->supportsDenormalization($data, $type, $format); + return $this->format === $format && $this->serializer->supportsDenormalization($data, $type, $format, $context); } /** @@ -98,9 +98,9 @@ public function normalize($object, $format = null, array $context = []): array|s /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { - return $this->format === $format && $this->serializer->supportsNormalization($data, $format); + return $this->format === $format && $this->serializer->supportsNormalization($data, $format, $context); } /** @@ -191,7 +191,7 @@ public function setPropertiesFromResponse(ResponseInterface $response, EntityInt /** * {@inheritdoc} */ - public function decode($data, $format, array $context = []) + public function decode($data, $format, array $context = []): mixed { return $this->serializer->decode($data, $format, $context); } diff --git a/src/Serializer/JsonDecode.php b/src/Serializer/JsonDecode.php index 76dd8953..a304fe9e 100644 --- a/src/Serializer/JsonDecode.php +++ b/src/Serializer/JsonDecode.php @@ -79,7 +79,7 @@ public function __construct($defaultContext = [], int $depth = 512) /** * {@inheritdoc} */ - public function decode($data, $format, array $context = []): mixed + public function decode($data, $format, array $context = []): mixed: mixed { $context['json_decode_options'] = empty($context['json_decode_options']) ? $this->options : $context['json_decode_options']; From c3ac78992e2b712854ea0c0165ab56cf6c8d6c23 Mon Sep 17 00:00:00 2001 From: Kedar Khaire Date: Fri, 25 Oct 2024 12:25:32 +0530 Subject: [PATCH 5/5] Changes for last few fixes --- src/Api/Management/Normalizer/CompanyMembershipNormalizer.php | 2 +- src/Normalizer/CredentialProductNormalizer.php | 2 +- src/Normalizer/ObjectNormalizer.php | 4 ++-- src/Normalizer/PropertiesPropertyNormalizer.php | 2 +- src/Serializer/EntitySerializer.php | 1 + src/Serializer/JsonDecode.php | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Api/Management/Normalizer/CompanyMembershipNormalizer.php b/src/Api/Management/Normalizer/CompanyMembershipNormalizer.php index a1868d42..1bf68937 100644 --- a/src/Api/Management/Normalizer/CompanyMembershipNormalizer.php +++ b/src/Api/Management/Normalizer/CompanyMembershipNormalizer.php @@ -41,7 +41,7 @@ public function normalize($object, $format = null, array $context = []): array|s // convert to ArrayObject as symfony normalizer throws error for std object. // set ARRAY_AS_PROPS flag as we need entries to be accessed as properties. - return new ArrayObject($normalized, ArrayObject::ARRAY_AS_PROPS); + return new \ArrayObject($normalized, \ArrayObject::ARRAY_AS_PROPS); } /** diff --git a/src/Normalizer/CredentialProductNormalizer.php b/src/Normalizer/CredentialProductNormalizer.php index f18710b4..d8e5599d 100644 --- a/src/Normalizer/CredentialProductNormalizer.php +++ b/src/Normalizer/CredentialProductNormalizer.php @@ -42,7 +42,7 @@ public function normalize($object, $format = null, array $context = []): array|s // Need to convert to ArrayObject as symfony normalizer throws error for std object. // Need to set ARRAY_AS_PROPS flag as we need Entries to be accessed as properties. - return new ArrayObject($asObject, ArrayObject::ARRAY_AS_PROPS); + return new \ArrayObject($asObject, \ArrayObject::ARRAY_AS_PROPS); } /** diff --git a/src/Normalizer/ObjectNormalizer.php b/src/Normalizer/ObjectNormalizer.php index 18aa1dec..fa729d51 100644 --- a/src/Normalizer/ObjectNormalizer.php +++ b/src/Normalizer/ObjectNormalizer.php @@ -129,10 +129,10 @@ public function setSerializer(SerializerInterface $serializer): void /** * {@inheritDoc} */ - public function convertToArrayObject($normalized, $array_as_props = ArrayObject::ARRAY_AS_PROPS) + public function convertToArrayObject($normalized, $array_as_props = \ArrayObject::ARRAY_AS_PROPS) { // default set ARRAY_AS_PROPS flag as we need entries to be accessed as properties. - return new ArrayObject($normalized, $array_as_props); + return new \ArrayObject($normalized, $array_as_props); } /** diff --git a/src/Normalizer/PropertiesPropertyNormalizer.php b/src/Normalizer/PropertiesPropertyNormalizer.php index 1b3e56dd..12d7247b 100644 --- a/src/Normalizer/PropertiesPropertyNormalizer.php +++ b/src/Normalizer/PropertiesPropertyNormalizer.php @@ -41,7 +41,7 @@ public function normalize($object, $format = null, array $context = []): array|s // convert to ArrayObject as symfony normalizer throws error for std object. // set ARRAY_AS_PROPS flag as we need entries to be accessed as properties. - return new ArrayObject($return, ArrayObject::ARRAY_AS_PROPS); + return new \ArrayObject($return, \ArrayObject::ARRAY_AS_PROPS); } /** diff --git a/src/Serializer/EntitySerializer.php b/src/Serializer/EntitySerializer.php index bf03a57d..53405fff 100755 --- a/src/Serializer/EntitySerializer.php +++ b/src/Serializer/EntitySerializer.php @@ -25,6 +25,7 @@ use Apigee\Edge\Normalizer\EdgeDateNormalizer; use Apigee\Edge\Normalizer\KeyValueMapNormalizer; use Apigee\Edge\Normalizer\ObjectNormalizer; +use Apigee\Edge\Serializer\JsonDecode; use Psr\Http\Message\ResponseInterface; use ReflectionMethod; use ReflectionObject; diff --git a/src/Serializer/JsonDecode.php b/src/Serializer/JsonDecode.php index a304fe9e..76dd8953 100644 --- a/src/Serializer/JsonDecode.php +++ b/src/Serializer/JsonDecode.php @@ -79,7 +79,7 @@ public function __construct($defaultContext = [], int $depth = 512) /** * {@inheritdoc} */ - public function decode($data, $format, array $context = []): mixed: mixed + public function decode($data, $format, array $context = []): mixed { $context['json_decode_options'] = empty($context['json_decode_options']) ? $this->options : $context['json_decode_options'];