Skip to content

Commit

Permalink
Fix for other types
Browse files Browse the repository at this point in the history
  • Loading branch information
kedarkhaire committed Oct 18, 2024
1 parent df6f2a1 commit dff231c
Show file tree
Hide file tree
Showing 48 changed files with 82 additions and 118 deletions.
5 changes: 2 additions & 3 deletions src/Api/ApigeeX/Normalizer/AcceptedRatePlanNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
use Apigee\Edge\Api\ApigeeX\Entity\AcceptedRatePlanInterface;
use Apigee\Edge\Api\Monetization\Normalizer\EntityNormalizer;
use Apigee\Edge\Api\Monetization\Utility\TimezoneFixerHelperTrait;
use ArrayObject;

class AcceptedRatePlanNormalizer extends EntityNormalizer
{
Expand All @@ -33,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 = []): array|string|int|float|bool|ArrayObject|null
public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
{
/** @var AcceptedRatePlanInterface $object */
/** @var object $normalized */
Expand All @@ -45,7 +44,7 @@ public function normalize($object, $format = null, array $context = []): array|s
/**
* {@inheritdoc}
*/
public function supportsNormalization($data, $format = null)
public function supportsNormalization($data, $format = null): bool
{
return $data instanceof AcceptedRatePlanInterface;
}
Expand Down
5 changes: 2 additions & 3 deletions src/Api/ApigeeX/Normalizer/ApiProductNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
use Apigee\Edge\Api\ApigeeX\Entity\ApiProductInterface;
use Apigee\Edge\Api\Monetization\NameConverter\ApiPackageNameConverter;
use Apigee\Edge\Api\Monetization\Normalizer\EntityNormalizer;
use ArrayObject;
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface;
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
Expand Down Expand Up @@ -49,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 = []): array|string|int|float|bool|ArrayObject|null
public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
{
$normalized = parent::normalize($object, $format, $context);

Expand All @@ -59,7 +58,7 @@ public function normalize($object, $format = null, array $context = []): array|s
/**
* {@inheritdoc}
*/
public function supportsNormalization($data, $format = null)
public function supportsNormalization($data, $format = null): bool
{
return $data instanceof ApiProductInterface;
}
Expand Down
5 changes: 2 additions & 3 deletions src/Api/ApigeeX/Normalizer/AppGroupMembershipNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
namespace Apigee\Edge\Api\ApigeeX\Normalizer;

use Apigee\Edge\Api\ApigeeX\Structure\AppGroupMembership;
use ArrayObject;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;

class AppGroupMembershipNormalizer implements NormalizerInterface
Expand All @@ -30,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 = []): array|string|int|float|bool|ArrayObject|null
public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
{
$normalized = [];

Expand All @@ -45,7 +44,7 @@ public function normalize($object, $format = null, array $context = []): array|s
/**
* {@inheritdoc}
*/
public function supportsNormalization($data, $format = null)
public function supportsNormalization($data, $format = null): bool
{
return $data instanceof AppGroupMembership;
}
Expand Down
5 changes: 2 additions & 3 deletions src/Api/ApigeeX/Normalizer/AppNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

use Apigee\Edge\Api\Management\Entity\AppInterface;
use Apigee\Edge\Normalizer\ObjectNormalizer;
use ArrayObject;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;

/**
Expand All @@ -31,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;
}
Expand All @@ -42,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 = []): array|string|int|float|bool|ArrayObject|null
public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
{
/** @var object $normalized */
$normalized = parent::normalize($object, $format, $context);
Expand Down
5 changes: 2 additions & 3 deletions src/Api/ApigeeX/Normalizer/BillingTypeNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

use Apigee\Edge\Api\ApigeeX\Entity\BillingTypeInterface;
use Apigee\Edge\Api\Monetization\Normalizer\EntityNormalizer;
use ArrayObject;

class BillingTypeNormalizer extends EntityNormalizer
{
Expand All @@ -30,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 = []): array|string|int|float|bool|ArrayObject|null
public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
{
/** @var BillingTypeInterface $object */
/** @var object $normalized */
Expand All @@ -42,7 +41,7 @@ public function normalize($object, $format = null, array $context = []): array|s
/**
* {@inheritdoc}
*/
public function supportsNormalization($data, $format = null)
public function supportsNormalization($data, $format = null): bool
{
return $data instanceof BillingTypeInterface;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Api/ApigeeX/Normalizer/PrepaidBalanceNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
5 changes: 2 additions & 3 deletions src/Api/ApigeeX/Normalizer/RatePlanNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
use Apigee\Edge\Api\Monetization\Normalizer\EntityNormalizer;
use Apigee\Edge\Api\Monetization\Utility\TimezoneFixerHelperTrait;
use Apigee\Edge\Exception\UninitializedPropertyException;
use ArrayObject;
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface;
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
Expand Down Expand Up @@ -53,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 = []): array|string|int|float|bool|ArrayObject|null
public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
{
/** @var object $normalized */
$normalized = parent::normalize($object, $format, $context);
Expand All @@ -71,7 +70,7 @@ public function normalize($object, $format = null, array $context = []): array|s
/**
* {@inheritdoc}
*/
public function supportsNormalization($data, $format = null)
public function supportsNormalization($data, $format = null): bool
{
return $data instanceof RatePlanInterface;
}
Expand Down
5 changes: 2 additions & 3 deletions src/Api/ApigeeX/Normalizer/RatePlanNormalizerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
use Apigee\Edge\Api\Monetization\Normalizer\CompanyRatePlanNormalizer;
use Apigee\Edge\Api\Monetization\Normalizer\DeveloperCategoryRatePlanNormalizer;
use Apigee\Edge\Api\Monetization\Normalizer\DeveloperRatePlanNormalizer;
use ArrayObject;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
use Symfony\Component\Serializer\SerializerAwareInterface;
use Symfony\Component\Serializer\SerializerAwareTrait;
Expand Down Expand Up @@ -57,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 = []): array|string|int|float|bool|ArrayObject|null
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
Expand All @@ -71,7 +70,7 @@ public function normalize($object, $format = null, array $context = []): array|s
/**
* {@inheritdoc}
*/
public function supportsNormalization($data, $format = null)
public function supportsNormalization($data, $format = null): bool
{
foreach ($this->normalizers as $denormalizer) {
if ($denormalizer->supportsNormalization($data, $format)) {
Expand Down
5 changes: 2 additions & 3 deletions src/Api/ApigeeX/Normalizer/RatePlanRateNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
use Apigee\Edge\Api\Monetization\Structure\RatePlanRate;
use Apigee\Edge\Api\Monetization\Structure\RatePlanRateRevShare;
use Apigee\Edge\Normalizer\ObjectNormalizer;
use ArrayObject;

class RatePlanRateNormalizer extends ObjectNormalizer
{
Expand All @@ -31,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 = []): array|string|int|float|bool|ArrayObject|null
public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
{
/** @var object $normalized */
$normalized = parent::normalize($object, $format, $context);
Expand All @@ -47,7 +46,7 @@ public function normalize($object, $format = null, array $context = []): array|s
/**
* {@inheritdoc}
*/
public function supportsNormalization($data, $format = null)
public function supportsNormalization($data, $format = null): bool
{
return $data instanceof RatePlanRate;
}
Expand Down
5 changes: 2 additions & 3 deletions src/Api/ApigeeX/Normalizer/StandardRatePlanNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

use Apigee\Edge\Api\ApigeeX\Entity\RatePlanInterface;
use Apigee\Edge\Api\ApigeeX\Entity\StandardRatePlanInterface;
use ArrayObject;

class StandardRatePlanNormalizer extends RatePlanNormalizer
{
Expand All @@ -30,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 = []): array|string|int|float|bool|ArrayObject|null
public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
{
/** @var object $normalized */
$normalized = parent::normalize($object, $format, $context);
Expand All @@ -42,7 +41,7 @@ public function normalize($object, $format = null, array $context = []): array|s
/**
* {@inheritdoc}
*/
public function supportsNormalization($data, $format = null)
public function supportsNormalization($data, $format = null): bool
{
return $data instanceof StandardRatePlanInterface;
}
Expand Down
5 changes: 2 additions & 3 deletions src/Api/Management/Normalizer/AppCredentialNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

use Apigee\Edge\Api\Management\Entity\AppCredentialInterface;
use Apigee\Edge\Normalizer\ObjectNormalizer;
use ArrayObject;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;

/**
Expand All @@ -31,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;
}
Expand All @@ -42,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 = []): array|string|int|float|bool|ArrayObject|null
public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
{
/** @var object $normalized */
$normalized = parent::normalize($object, $format, $context);
Expand Down
5 changes: 2 additions & 3 deletions src/Api/Management/Normalizer/AppNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

use Apigee\Edge\Api\Management\Entity\AppInterface;
use Apigee\Edge\Normalizer\ObjectNormalizer;
use ArrayObject;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;

/**
Expand All @@ -31,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;
}
Expand All @@ -42,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 = []): array|string|int|float|bool|ArrayObject|null
public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
{
/** @var object $normalized */
$normalized = parent::normalize($object, $format, $context);
Expand Down
5 changes: 2 additions & 3 deletions src/Api/Management/Normalizer/CompanyMembershipNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 = []): array|string|int|float|bool|ArrayObject|null
public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
{
$normalized = [
'developer' => [],
Expand All @@ -48,7 +47,7 @@ public function normalize($object, $format = null, array $context = []): array|s
/**
* {@inheritdoc}
*/
public function supportsNormalization($data, $format = null)
public function supportsNormalization($data, $format = null): bool
{
return $data instanceof CompanyMembership;
}
Expand Down
5 changes: 2 additions & 3 deletions src/Api/Management/Query/StatsQueryNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
namespace Apigee\Edge\Api\Management\Query;

use Apigee\Edge\Serializer\JsonEncoder;
use ArrayObject;
use DateTimeZone;
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
Expand Down Expand Up @@ -53,7 +52,7 @@ public function __construct()
/**
* {@inheritdoc}
*/
public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|ArrayObject|null
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.
Expand Down Expand Up @@ -93,7 +92,7 @@ public function normalize($object, $format = null, array $context = []): array|s
/**
* {@inheritdoc}
*/
public function supportsNormalization($data, $format = null)
public function supportsNormalization($data, $format = null): bool
{
return $data instanceof StatsQuery;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

use Apigee\Edge\Api\Monetization\Entity\AcceptedRatePlanInterface;
use Apigee\Edge\Api\Monetization\Utility\TimezoneFixerHelperTrait;
use ArrayObject;

class AcceptedRatePlanNormalizer extends EntityNormalizer
{
Expand All @@ -32,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 = []): array|string|int|float|bool|ArrayObject|null
public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
{
/** @var AcceptedRatePlanInterface $object */
/** @var object $normalized */
Expand All @@ -45,7 +44,7 @@ public function normalize($object, $format = null, array $context = []): array|s
/**
* {@inheritdoc}
*/
public function supportsNormalization($data, $format = null)
public function supportsNormalization($data, $format = null): bool
{
return $data instanceof AcceptedRatePlanInterface;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Api/Monetization/Normalizer/AddressNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Loading

0 comments on commit dff231c

Please sign in to comment.