diff --git a/src/Api/ApigeeX/Normalizer/AcceptedRatePlanNormalizer.php b/src/Api/ApigeeX/Normalizer/AcceptedRatePlanNormalizer.php index e84a51c4..abe09791 100755 --- a/src/Api/ApigeeX/Normalizer/AcceptedRatePlanNormalizer.php +++ b/src/Api/ApigeeX/Normalizer/AcceptedRatePlanNormalizer.php @@ -32,7 +32,7 @@ class AcceptedRatePlanNormalizer extends EntityNormalizer * @psalm-suppress InvalidReturnType Returning an object here is required * for creating a valid Apigee Edge request. */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { /** @var AcceptedRatePlanInterface $object */ /** @var object $normalized */ @@ -44,7 +44,7 @@ public function normalize($object, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null) + public function supportsNormalization($data, $format = null): bool { return $data instanceof AcceptedRatePlanInterface; } diff --git a/src/Api/ApigeeX/Normalizer/ApiProductNormalizer.php b/src/Api/ApigeeX/Normalizer/ApiProductNormalizer.php index 05ab9e6c..4ab87a1d 100755 --- a/src/Api/ApigeeX/Normalizer/ApiProductNormalizer.php +++ b/src/Api/ApigeeX/Normalizer/ApiProductNormalizer.php @@ -48,7 +48,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory * @psalm-suppress InvalidReturnType Returning an object here is required * for creating a valid Apigee Edge request. */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { $normalized = parent::normalize($object, $format, $context); @@ -58,7 +58,7 @@ public function normalize($object, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null) + public function supportsNormalization($data, $format = null): bool { return $data instanceof ApiProductInterface; } diff --git a/src/Api/ApigeeX/Normalizer/AppGroupMembershipNormalizer.php b/src/Api/ApigeeX/Normalizer/AppGroupMembershipNormalizer.php index f0fba9e9..280a358a 100644 --- a/src/Api/ApigeeX/Normalizer/AppGroupMembershipNormalizer.php +++ b/src/Api/ApigeeX/Normalizer/AppGroupMembershipNormalizer.php @@ -29,7 +29,7 @@ class AppGroupMembershipNormalizer implements NormalizerInterface * @psalm-suppress InvalidReturnType Returning an object here is required * for creating a valid Apigee Edge request. */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { $normalized = []; @@ -44,8 +44,18 @@ public function normalize($object, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null) + public function supportsNormalization($data, $format = null): bool { return $data instanceof AppGroupMembership; } + + /** + * {@inheritdoc} + */ + public function getSupportedTypes(?string $format): array + { + return [ + AppGroupMembership::class => true, + ]; + } } diff --git a/src/Api/ApigeeX/Normalizer/AppNormalizer.php b/src/Api/ApigeeX/Normalizer/AppNormalizer.php index 3f7b3564..8eb0b9e1 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) + public function supportsNormalization($data, $format = null): bool { return $data instanceof AppInterface; } @@ -41,7 +41,7 @@ public function supportsNormalization($data, $format = null) * @psalm-suppress InvalidReturnType Returning an object here is required * for creating a valid Apigee Edge request. */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { /** @var object $normalized */ $normalized = parent::normalize($object, $format, $context); diff --git a/src/Api/ApigeeX/Normalizer/BillingTypeNormalizer.php b/src/Api/ApigeeX/Normalizer/BillingTypeNormalizer.php index a7e73b0d..25a35d4f 100644 --- a/src/Api/ApigeeX/Normalizer/BillingTypeNormalizer.php +++ b/src/Api/ApigeeX/Normalizer/BillingTypeNormalizer.php @@ -29,7 +29,7 @@ class BillingTypeNormalizer extends EntityNormalizer * @psalm-suppress InvalidReturnType Returning an object here is required * for creating a valid Apigee Edge request. */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { /** @var BillingTypeInterface $object */ /** @var object $normalized */ @@ -41,7 +41,7 @@ public function normalize($object, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null) + public function supportsNormalization($data, $format = null): bool { return $data instanceof BillingTypeInterface; } diff --git a/src/Api/ApigeeX/Normalizer/PrepaidBalanceNormalizer.php b/src/Api/ApigeeX/Normalizer/PrepaidBalanceNormalizer.php index 72f9bb10..6a9ee05e 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) + public function supportsNormalization($data, $format = null): bool { return $data instanceof PrepaidBalanceInterface; } diff --git a/src/Api/ApigeeX/Normalizer/RatePlanNormalizer.php b/src/Api/ApigeeX/Normalizer/RatePlanNormalizer.php index c8a45393..b78d8268 100755 --- a/src/Api/ApigeeX/Normalizer/RatePlanNormalizer.php +++ b/src/Api/ApigeeX/Normalizer/RatePlanNormalizer.php @@ -52,7 +52,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory * @psalm-suppress InvalidReturnType Returning an object here is required * for creating a valid Apigee Edge request. */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { /** @var object $normalized */ $normalized = parent::normalize($object, $format, $context); @@ -70,7 +70,7 @@ public function normalize($object, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null) + public function supportsNormalization($data, $format = null): bool { return $data instanceof RatePlanInterface; } diff --git a/src/Api/ApigeeX/Normalizer/RatePlanNormalizerFactory.php b/src/Api/ApigeeX/Normalizer/RatePlanNormalizerFactory.php index 3debb38a..70730221 100755 --- a/src/Api/ApigeeX/Normalizer/RatePlanNormalizerFactory.php +++ b/src/Api/ApigeeX/Normalizer/RatePlanNormalizerFactory.php @@ -56,7 +56,7 @@ public function __construct(array $normalizers = []) * @psalm-suppress InvalidNullableReturnType - There are going to be at * least one normalizer always that can normalize data here. */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { foreach ($this->normalizers as $normalizer) { // Return the result from the first denormalizer that can @@ -70,7 +70,7 @@ public function normalize($object, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null) + public function supportsNormalization($data, $format = null): bool { foreach ($this->normalizers as $denormalizer) { if ($denormalizer->supportsNormalization($data, $format)) { diff --git a/src/Api/ApigeeX/Normalizer/RatePlanRateNormalizer.php b/src/Api/ApigeeX/Normalizer/RatePlanRateNormalizer.php index e2626f1c..d1214aa6 100755 --- a/src/Api/ApigeeX/Normalizer/RatePlanRateNormalizer.php +++ b/src/Api/ApigeeX/Normalizer/RatePlanRateNormalizer.php @@ -30,7 +30,7 @@ class RatePlanRateNormalizer extends ObjectNormalizer * @psalm-suppress InvalidReturnType Returning an object here is required * for creating a valid Apigee Edge request. */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { /** @var object $normalized */ $normalized = parent::normalize($object, $format, $context); @@ -46,7 +46,7 @@ public function normalize($object, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null) + public function supportsNormalization($data, $format = null): bool { return $data instanceof RatePlanRate; } diff --git a/src/Api/ApigeeX/Normalizer/StandardRatePlanNormalizer.php b/src/Api/ApigeeX/Normalizer/StandardRatePlanNormalizer.php index dda8754f..b0874e41 100755 --- a/src/Api/ApigeeX/Normalizer/StandardRatePlanNormalizer.php +++ b/src/Api/ApigeeX/Normalizer/StandardRatePlanNormalizer.php @@ -29,7 +29,7 @@ class StandardRatePlanNormalizer extends RatePlanNormalizer * @psalm-suppress InvalidReturnType Returning an object here is required * for creating a valid Apigee Edge request. */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { /** @var object $normalized */ $normalized = parent::normalize($object, $format, $context); @@ -41,7 +41,7 @@ public function normalize($object, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null) + public function supportsNormalization($data, $format = null): bool { return $data instanceof StandardRatePlanInterface; } diff --git a/src/Api/Management/Normalizer/AppCredentialNormalizer.php b/src/Api/Management/Normalizer/AppCredentialNormalizer.php index 0903c413..21d88a4d 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) + public function supportsNormalization($data, $format = null): bool { return $data instanceof AppCredentialInterface; } @@ -41,7 +41,7 @@ public function supportsNormalization($data, $format = null) * @psalm-suppress InvalidReturnType Returning an object here is required * for creating a valid Apigee Edge request. */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { /** @var object $normalized */ $normalized = parent::normalize($object, $format, $context); diff --git a/src/Api/Management/Normalizer/AppNormalizer.php b/src/Api/Management/Normalizer/AppNormalizer.php index 5010f277..e94276cb 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) + public function supportsNormalization($data, $format = null): bool { return $data instanceof AppInterface; } @@ -41,7 +41,7 @@ public function supportsNormalization($data, $format = null) * @psalm-suppress InvalidReturnType Returning an object here is required * for creating a valid Apigee Edge request. */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { /** @var object $normalized */ $normalized = parent::normalize($object, $format, $context); diff --git a/src/Api/Management/Normalizer/CompanyMembershipNormalizer.php b/src/Api/Management/Normalizer/CompanyMembershipNormalizer.php index 68065c92..8e36875d 100644 --- a/src/Api/Management/Normalizer/CompanyMembershipNormalizer.php +++ b/src/Api/Management/Normalizer/CompanyMembershipNormalizer.php @@ -19,7 +19,6 @@ namespace Apigee\Edge\Api\Management\Normalizer; use Apigee\Edge\Api\Management\Structure\CompanyMembership; -use ArrayObject; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; class CompanyMembershipNormalizer implements NormalizerInterface @@ -30,7 +29,7 @@ class CompanyMembershipNormalizer implements NormalizerInterface * @psalm-suppress InvalidReturnType Returning an object here is required * for creating a valid Apigee Edge request. */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { $normalized = [ 'developer' => [], @@ -42,13 +41,13 @@ public function normalize($object, $format = null, array $context = []) // 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) + public function supportsNormalization($data, $format = null): bool { return $data instanceof CompanyMembership; } diff --git a/src/Api/Management/Query/StatsQueryNormalizer.php b/src/Api/Management/Query/StatsQueryNormalizer.php index 0bff438a..dc50bcd6 100644 --- a/src/Api/Management/Query/StatsQueryNormalizer.php +++ b/src/Api/Management/Query/StatsQueryNormalizer.php @@ -52,7 +52,7 @@ public function __construct() /** * {@inheritdoc} */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { /** @var StatsQueryInterface $object */ // Transform the object to JSON and back to an array to keep boolean values as boolean. @@ -92,7 +92,7 @@ public function normalize($object, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null) + public function supportsNormalization($data, $format = null): bool { return $data instanceof StatsQuery; } diff --git a/src/Api/Monetization/Normalizer/AcceptedRatePlanNormalizer.php b/src/Api/Monetization/Normalizer/AcceptedRatePlanNormalizer.php index 85242c3b..170a79e4 100644 --- a/src/Api/Monetization/Normalizer/AcceptedRatePlanNormalizer.php +++ b/src/Api/Monetization/Normalizer/AcceptedRatePlanNormalizer.php @@ -31,7 +31,7 @@ class AcceptedRatePlanNormalizer extends EntityNormalizer * @psalm-suppress InvalidReturnType Returning an object here is required * for creating a valid Apigee Edge request. */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { /** @var AcceptedRatePlanInterface $object */ /** @var object $normalized */ @@ -44,7 +44,7 @@ public function normalize($object, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null) + public function supportsNormalization($data, $format = null): bool { return $data instanceof AcceptedRatePlanInterface; } diff --git a/src/Api/Monetization/Normalizer/AddressNormalizer.php b/src/Api/Monetization/Normalizer/AddressNormalizer.php index 952074d7..b2f94129 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) + public function supportsNormalization($data, $format = null): bool { return $data instanceof Address; } diff --git a/src/Api/Monetization/Normalizer/ApiPackageNormalizer.php b/src/Api/Monetization/Normalizer/ApiPackageNormalizer.php index 1be6dfb4..022922ee 100644 --- a/src/Api/Monetization/Normalizer/ApiPackageNormalizer.php +++ b/src/Api/Monetization/Normalizer/ApiPackageNormalizer.php @@ -47,7 +47,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory * @psalm-suppress InvalidReturnType Returning an object here is required * for creating a valid Apigee Edge request. */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { $normalized = (array) parent::normalize($object, $format, $context); @@ -63,7 +63,7 @@ public function normalize($object, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null) + public function supportsNormalization($data, $format = null): bool { return $data instanceof ApiPackageInterface; } diff --git a/src/Api/Monetization/Normalizer/BalanceNormalizer.php b/src/Api/Monetization/Normalizer/BalanceNormalizer.php index caf718ba..e467b88b 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) + public function supportsNormalization($data, $format = null): bool { return $data instanceof BalanceInterface; } diff --git a/src/Api/Monetization/Normalizer/CompanyAcceptedRatePlanNormalizer.php b/src/Api/Monetization/Normalizer/CompanyAcceptedRatePlanNormalizer.php index c1331400..98341571 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) + public function supportsNormalization($data, $format = null): bool { return $data instanceof CompanyAcceptedRatePlanInterface; } diff --git a/src/Api/Monetization/Normalizer/CompanyPaymentTransactionNormalizer.php b/src/Api/Monetization/Normalizer/CompanyPaymentTransactionNormalizer.php index f86a78d6..1a3f9577 100644 --- a/src/Api/Monetization/Normalizer/CompanyPaymentTransactionNormalizer.php +++ b/src/Api/Monetization/Normalizer/CompanyPaymentTransactionNormalizer.php @@ -47,7 +47,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory * @psalm-suppress InvalidReturnType Returning an object here is required * for creating a valid Apigee Edge request. */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { /** @var object $normalized */ $normalized = parent::normalize($object, $format, $context); @@ -59,7 +59,7 @@ public function normalize($object, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null) + public function supportsNormalization($data, $format = null): bool { return $data instanceof CompanyPaymentTransaction; } diff --git a/src/Api/Monetization/Normalizer/CompanyRatePlanNormalizer.php b/src/Api/Monetization/Normalizer/CompanyRatePlanNormalizer.php index cfc5eaab..2851b632 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) + public function supportsNormalization($data, $format = null): bool { return $data instanceof CompanyRatePlanInterface; } diff --git a/src/Api/Monetization/Normalizer/CompanyReportDefinitionNormalizer.php b/src/Api/Monetization/Normalizer/CompanyReportDefinitionNormalizer.php index 3c155635..22974aea 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) + public function supportsNormalization($data, $format = null): bool { return $data instanceof CompanyReportDefinitionInterface; } diff --git a/src/Api/Monetization/Normalizer/DateTimeZoneNormalizer.php b/src/Api/Monetization/Normalizer/DateTimeZoneNormalizer.php index 8eba9f35..38cef829 100644 --- a/src/Api/Monetization/Normalizer/DateTimeZoneNormalizer.php +++ b/src/Api/Monetization/Normalizer/DateTimeZoneNormalizer.php @@ -26,7 +26,7 @@ class DateTimeZoneNormalizer implements NormalizerInterface /** * {@inheritdoc} */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { return $object->getName(); } @@ -34,7 +34,7 @@ public function normalize($object, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null) + public function supportsNormalization($data, $format = null): bool { return $data instanceof DateTimeZone; } diff --git a/src/Api/Monetization/Normalizer/DeveloperCategoryRatePlanNormalizer.php b/src/Api/Monetization/Normalizer/DeveloperCategoryRatePlanNormalizer.php index c56ffd0d..9f8788a6 100644 --- a/src/Api/Monetization/Normalizer/DeveloperCategoryRatePlanNormalizer.php +++ b/src/Api/Monetization/Normalizer/DeveloperCategoryRatePlanNormalizer.php @@ -29,7 +29,7 @@ class DeveloperCategoryRatePlanNormalizer extends RatePlanNormalizer * @psalm-suppress InvalidReturnType Returning an object here is required * for creating a valid Apigee Edge request. */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { /** @var object $normalized */ $normalized = parent::normalize($object, $format, $context); @@ -41,7 +41,7 @@ public function normalize($object, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null) + public function supportsNormalization($data, $format = null): bool { return $data instanceof DeveloperCategoryRatePlanInterface; } diff --git a/src/Api/Monetization/Normalizer/DeveloperPaymentTransactionNormalizer.php b/src/Api/Monetization/Normalizer/DeveloperPaymentTransactionNormalizer.php index 341a715a..139c6e38 100644 --- a/src/Api/Monetization/Normalizer/DeveloperPaymentTransactionNormalizer.php +++ b/src/Api/Monetization/Normalizer/DeveloperPaymentTransactionNormalizer.php @@ -28,7 +28,7 @@ class DeveloperPaymentTransactionNormalizer extends PaymentTransactionNormalizer * @psalm-suppress InvalidReturnType Returning an object here is required * for creating a valid Apigee Edge request. */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { /** @var object $normalized */ $normalized = parent::normalize($object, $format, $context); @@ -40,7 +40,7 @@ public function normalize($object, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null) + public function supportsNormalization($data, $format = null): bool { return $data instanceof DeveloperPaymentTransaction; } diff --git a/src/Api/Monetization/Normalizer/DeveloperRatePlanNormalizer.php b/src/Api/Monetization/Normalizer/DeveloperRatePlanNormalizer.php index 9c8f0ccb..1b9a3f85 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) + public function supportsNormalization($data, $format = null): bool { return $data instanceof DeveloperRatePlanInterface; } diff --git a/src/Api/Monetization/Normalizer/DeveloperReportDefinitionNormalizer.php b/src/Api/Monetization/Normalizer/DeveloperReportDefinitionNormalizer.php index 7a5739d5..9e804d59 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) + public function supportsNormalization($data, $format = null): bool { return $data instanceof DeveloperReportDefinitionInterface; } diff --git a/src/Api/Monetization/Normalizer/EntityNormalizer.php b/src/Api/Monetization/Normalizer/EntityNormalizer.php index cbae260c..0f7a8175 100644 --- a/src/Api/Monetization/Normalizer/EntityNormalizer.php +++ b/src/Api/Monetization/Normalizer/EntityNormalizer.php @@ -63,7 +63,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory * @psalm-suppress InvalidReturnType stdClass is also an object. * @psalm-suppress InvalidPropertyFetch. */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { $normalized = (array) parent::normalize($object, $format, $context); diff --git a/src/Api/Monetization/Normalizer/LegalEntityNormalizer.php b/src/Api/Monetization/Normalizer/LegalEntityNormalizer.php index 3259c4e6..70fb383c 100644 --- a/src/Api/Monetization/Normalizer/LegalEntityNormalizer.php +++ b/src/Api/Monetization/Normalizer/LegalEntityNormalizer.php @@ -49,7 +49,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory * @psalm-suppress InvalidReturnType Returning an object here is required * for creating a valid Apigee Edge request. */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { /** @var object $normalized */ $normalized = parent::normalize($object, $format, $context); @@ -66,7 +66,7 @@ public function normalize($object, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null) + public function supportsNormalization($data, $format = null): bool { return $data instanceof LegalEntityInterface; } diff --git a/src/Api/Monetization/Normalizer/LegalEntityRatePlanNormalizer.php b/src/Api/Monetization/Normalizer/LegalEntityRatePlanNormalizer.php index 50c51842..bae1a783 100644 --- a/src/Api/Monetization/Normalizer/LegalEntityRatePlanNormalizer.php +++ b/src/Api/Monetization/Normalizer/LegalEntityRatePlanNormalizer.php @@ -28,7 +28,7 @@ abstract class LegalEntityRatePlanNormalizer extends RatePlanNormalizer * @psalm-suppress InvalidReturnType Returning an object here is required * for creating a valid Apigee Edge request. */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { /** @var object $normalized */ $normalized = parent::normalize($object, $format, $context); diff --git a/src/Api/Monetization/Normalizer/LegalEntityReportDefinitionNormalizer.php b/src/Api/Monetization/Normalizer/LegalEntityReportDefinitionNormalizer.php index 54f1bb9e..bcd7e489 100644 --- a/src/Api/Monetization/Normalizer/LegalEntityReportDefinitionNormalizer.php +++ b/src/Api/Monetization/Normalizer/LegalEntityReportDefinitionNormalizer.php @@ -18,6 +18,7 @@ namespace Apigee\Edge\Api\Monetization\Normalizer; + abstract class LegalEntityReportDefinitionNormalizer extends ReportDefinitionNormalizer { /** @@ -26,7 +27,7 @@ abstract class LegalEntityReportDefinitionNormalizer extends ReportDefinitionNor * @psalm-suppress InvalidReturnType Returning an object here is required * for creating a valid Apigee Edge request. */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { /** @var object $normalized */ $normalized = parent::normalize($object, $format, $context); diff --git a/src/Api/Monetization/Normalizer/OrganizationProfileNormalizer.php b/src/Api/Monetization/Normalizer/OrganizationProfileNormalizer.php index fdde13ac..fc4d9448 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) + public function supportsNormalization($data, $format = null): bool { return $data instanceof OrganizationProfileInterface; } diff --git a/src/Api/Monetization/Normalizer/PaymentTransactionNormalizer.php b/src/Api/Monetization/Normalizer/PaymentTransactionNormalizer.php index 065f868d..0c0e9826 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) + public function supportsNormalization($data, $format = null): bool { return $data instanceof PaymentTransaction; } diff --git a/src/Api/Monetization/Normalizer/PrepaidBalanceNormalizer.php b/src/Api/Monetization/Normalizer/PrepaidBalanceNormalizer.php index 0cbc4557..7cb321e9 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) + public function supportsNormalization($data, $format = null): bool { return $data instanceof PrepaidBalanceInterface; } diff --git a/src/Api/Monetization/Normalizer/RatePlanNormalizer.php b/src/Api/Monetization/Normalizer/RatePlanNormalizer.php index 95b008f4..e4d8a78c 100644 --- a/src/Api/Monetization/Normalizer/RatePlanNormalizer.php +++ b/src/Api/Monetization/Normalizer/RatePlanNormalizer.php @@ -51,7 +51,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory * @psalm-suppress InvalidReturnType Returning an object here is required * for creating a valid Apigee Edge request. */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { /** @var object $normalized */ $normalized = parent::normalize($object, $format, $context); @@ -75,7 +75,7 @@ public function normalize($object, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null) + public function supportsNormalization($data, $format = null): bool { return $data instanceof RatePlanInterface; } diff --git a/src/Api/Monetization/Normalizer/RatePlanNormalizerFactory.php b/src/Api/Monetization/Normalizer/RatePlanNormalizerFactory.php index 0af7aff6..b62fc8bb 100644 --- a/src/Api/Monetization/Normalizer/RatePlanNormalizerFactory.php +++ b/src/Api/Monetization/Normalizer/RatePlanNormalizerFactory.php @@ -53,7 +53,7 @@ public function __construct(array $normalizers = []) * @psalm-suppress InvalidNullableReturnType - There are going to be at * least one normalizer always that can normalize data here. */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { foreach ($this->normalizers as $normalizer) { // Return the result from the first denormalizer that can @@ -67,7 +67,7 @@ public function normalize($object, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null) + public function supportsNormalization($data, $format = null): bool { foreach ($this->normalizers as $denormalizer) { if ($denormalizer->supportsNormalization($data, $format)) { diff --git a/src/Api/Monetization/Normalizer/RatePlanRateNormalizer.php b/src/Api/Monetization/Normalizer/RatePlanRateNormalizer.php index b8f47969..ced20de3 100644 --- a/src/Api/Monetization/Normalizer/RatePlanRateNormalizer.php +++ b/src/Api/Monetization/Normalizer/RatePlanRateNormalizer.php @@ -30,7 +30,7 @@ class RatePlanRateNormalizer extends ObjectNormalizer * @psalm-suppress InvalidReturnType Returning an object here is required * for creating a valid Apigee Edge request. */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { /** @var object $normalized */ $normalized = parent::normalize($object, $format, $context); @@ -46,7 +46,7 @@ public function normalize($object, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null) + public function supportsNormalization($data, $format = null): bool { return $data instanceof RatePlanRate; } diff --git a/src/Api/Monetization/Normalizer/ReportCriteriaNormalizer.php b/src/Api/Monetization/Normalizer/ReportCriteriaNormalizer.php index ff81fbd4..7776ce09 100644 --- a/src/Api/Monetization/Normalizer/ReportCriteriaNormalizer.php +++ b/src/Api/Monetization/Normalizer/ReportCriteriaNormalizer.php @@ -59,7 +59,7 @@ public function __construct(string $organization, ?ClassMetadataFactoryInterface * @psalm-suppress InvalidReturnType Returning an object here is required * for creating a valid Apigee Edge request. */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { /** @var object $normalized */ $normalized = parent::normalize($object, $format, $context); @@ -95,7 +95,7 @@ public function normalize($object, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null) + public function supportsNormalization($data, $format = null): bool { return $data instanceof AbstractCriteria; } diff --git a/src/Api/Monetization/Normalizer/ReportDefinitionNormalizer.php b/src/Api/Monetization/Normalizer/ReportDefinitionNormalizer.php index 2cf26536..f49affe1 100644 --- a/src/Api/Monetization/Normalizer/ReportDefinitionNormalizer.php +++ b/src/Api/Monetization/Normalizer/ReportDefinitionNormalizer.php @@ -50,7 +50,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory * @psalm-suppress InvalidReturnType Returning an object here is required * for creating a valid Apigee Edge request. */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { /** @var ReportDefinitionInterface $object */ /** @var object $normalized */ @@ -67,7 +67,7 @@ public function normalize($object, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null) + public function supportsNormalization($data, $format = null): bool { return $data instanceof ReportDefinitionInterface; } diff --git a/src/Api/Monetization/Normalizer/StandardRatePlanNormalizer.php b/src/Api/Monetization/Normalizer/StandardRatePlanNormalizer.php index 3914a8cf..a6f17a58 100644 --- a/src/Api/Monetization/Normalizer/StandardRatePlanNormalizer.php +++ b/src/Api/Monetization/Normalizer/StandardRatePlanNormalizer.php @@ -29,7 +29,7 @@ class StandardRatePlanNormalizer extends RatePlanNormalizer * @psalm-suppress InvalidReturnType Returning an object here is required * for creating a valid Apigee Edge request. */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { /** @var object $normalized */ $normalized = parent::normalize($object, $format, $context); @@ -41,7 +41,7 @@ public function normalize($object, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null) + public function supportsNormalization($data, $format = null): bool { return $data instanceof StandardRatePlanInterface; } diff --git a/src/Api/Monetization/Normalizer/SupportedCurrencyNormalizer.php b/src/Api/Monetization/Normalizer/SupportedCurrencyNormalizer.php index 13e36e4f..d2239970 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) + public function supportsNormalization($data, $format = null): bool { return $data instanceof SupportedCurrencyInterface; } diff --git a/src/Api/Monetization/Normalizer/TermsAndConditionsNormalizer.php b/src/Api/Monetization/Normalizer/TermsAndConditionsNormalizer.php index 80d5c8d1..70117e1f 100644 --- a/src/Api/Monetization/Normalizer/TermsAndConditionsNormalizer.php +++ b/src/Api/Monetization/Normalizer/TermsAndConditionsNormalizer.php @@ -51,7 +51,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory * @psalm-suppress InvalidReturnType Returning an object here is required * for creating a valid Apigee Edge request. */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { /** @var object $normalized */ $normalized = parent::normalize($object, $format, $context); @@ -72,7 +72,7 @@ public function normalize($object, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null) + public function supportsNormalization($data, $format = null): bool { return $data instanceof TermsAndConditionsInterface; } diff --git a/src/Normalizer/CredentialProductNormalizer.php b/src/Normalizer/CredentialProductNormalizer.php index 7a1b1adb..3e43bf23 100644 --- a/src/Normalizer/CredentialProductNormalizer.php +++ b/src/Normalizer/CredentialProductNormalizer.php @@ -19,7 +19,6 @@ namespace Apigee\Edge\Normalizer; use Apigee\Edge\Structure\CredentialProductInterface; -use ArrayObject; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; /** @@ -33,7 +32,7 @@ class CredentialProductNormalizer implements NormalizerInterface * @psalm-suppress InvalidReturnType Returning an object here is required * for creating a valid Apigee Edge request. */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { /* @var \Apigee\Edge\Structure\CredentialProductInterface $object */ $asObject = [ @@ -43,13 +42,13 @@ public function normalize($object, $format = null, array $context = []) // 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) + public function supportsNormalization($data, $format = null): bool { return $data instanceof CredentialProductInterface; } diff --git a/src/Normalizer/EdgeDateNormalizer.php b/src/Normalizer/EdgeDateNormalizer.php index 77025207..f63d7af6 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) + public function supportsNormalization($data, $format = null): bool { return $data instanceof DateTimeInterface; } @@ -34,7 +34,7 @@ public function supportsNormalization($data, $format = null) /** * {@inheritdoc} */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { /* @var \DateTimeInterface $object */ return $object->getTimestamp() * 1000; diff --git a/src/Normalizer/KeyValueMapNormalizer.php b/src/Normalizer/KeyValueMapNormalizer.php index 998c0427..1f7e0e5b 100644 --- a/src/Normalizer/KeyValueMapNormalizer.php +++ b/src/Normalizer/KeyValueMapNormalizer.php @@ -29,7 +29,7 @@ class KeyValueMapNormalizer implements NormalizerInterface /** * {@inheritdoc} */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { $return = []; foreach ($object->values() as $key => $value) { @@ -42,7 +42,7 @@ public function normalize($object, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null) + public function supportsNormalization($data, $format = null): bool { return $data instanceof KeyValueMapInterface; } diff --git a/src/Normalizer/ObjectNormalizer.php b/src/Normalizer/ObjectNormalizer.php index 644e9d21..666690f6 100644 --- a/src/Normalizer/ObjectNormalizer.php +++ b/src/Normalizer/ObjectNormalizer.php @@ -19,7 +19,6 @@ namespace Apigee\Edge\Normalizer; use Apigee\Edge\PropertyAccess\PropertyAccessorDecorator; -use ArrayObject; use Symfony\Component\PropertyAccess\PropertyAccess; use Symfony\Component\PropertyAccess\PropertyAccessorInterface; use Symfony\Component\PropertyInfo\Extractor\PhpDocExtractor; @@ -94,7 +93,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory * @psalm-suppress PossiblyInvalidArgument First argument of array_filter is always an array. * @psalm-suppress PossiblyNullArgument First argument of array_filter is always an array. */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { $asArray = $this->objectNormalizer->normalize($object, $this->format, $context); // Exclude null values from the output, even if PATCH is not supported on Apigee Edge @@ -110,7 +109,7 @@ public function normalize($object, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null) + public function supportsNormalization($data, $format = null): bool { // Enforce the only supported format if format is null. $format = $format ?? $this->format; @@ -130,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 7818c637..eb66bbd9 100644 --- a/src/Normalizer/PropertiesPropertyNormalizer.php +++ b/src/Normalizer/PropertiesPropertyNormalizer.php @@ -19,7 +19,6 @@ namespace Apigee\Edge\Normalizer; use Apigee\Edge\Structure\PropertiesProperty; -use ArrayObject; /** * Class PropertiesPropertyNormalizer. @@ -34,7 +33,7 @@ class PropertiesPropertyNormalizer extends KeyValueMapNormalizer * @psalm-suppress InvalidReturnType Returning an object here is required * for creating a valid Apigee Edge request. */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { $return = [ 'property' => parent::normalize($object, $format, $context), @@ -42,13 +41,13 @@ public function normalize($object, $format = null, array $context = []) // 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) + public function supportsNormalization($data, $format = null): bool { return $data instanceof PropertiesProperty; } diff --git a/src/Serializer/EntitySerializer.php b/src/Serializer/EntitySerializer.php index cf151fa4..d78d6c84 100755 --- a/src/Serializer/EntitySerializer.php +++ b/src/Serializer/EntitySerializer.php @@ -90,7 +90,7 @@ public function supportsDenormalization($data, $type, $format = null): bool /** * {@inheritdoc} */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { return $this->serializer->normalize($object, $format, $context); } @@ -98,7 +98,7 @@ public function normalize($object, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null) + public function supportsNormalization($data, $format = null): bool { return $this->format === $format && $this->serializer->supportsNormalization($data, $format); } @@ -199,7 +199,7 @@ public function decode($data, $format, array $context = []) /** * {@inheritdoc} */ - public function supportsDecoding($format) + public function supportsDecoding($format): bool { return $this->format === $format && $this->serializer->supportsDecoding($format); }