Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes made for symfony 7 standards, declaring return type and adding missing parameters #395

Merged
merged 5 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Api/ApigeeX/Denormalizer/AcceptedRatePlanDenormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Api/ApigeeX/Denormalizer/ApiProductDenormalizer.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 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)) {
Expand Down
4 changes: 2 additions & 2 deletions src/Api/ApigeeX/Denormalizer/AppDenormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'])) {
Expand All @@ -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)) {
Expand Down
4 changes: 2 additions & 2 deletions src/Api/ApigeeX/Denormalizer/BillingTypeDenormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ 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);
}

/**
* {@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;
}

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

/**
* {@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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
4 changes: 2 additions & 2 deletions src/Api/ApigeeX/Denormalizer/RatePlanDenormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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)) {
Expand Down
8 changes: 4 additions & 4 deletions src/Api/ApigeeX/Denormalizer/RatePlanDenormalizerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand All @@ -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;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Api/ApigeeX/Denormalizer/RatePlanRateDenormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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)) {
Expand Down
6 changes: 3 additions & 3 deletions src/Api/ApigeeX/Denormalizer/StandardRatePlanDenormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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';
}
Expand Down
2 changes: 1 addition & 1 deletion src/Api/ApigeeX/Normalizer/AcceptedRatePlanNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Api/ApigeeX/Normalizer/ApiProductNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Api/ApigeeX/Normalizer/AppNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Api/ApigeeX/Normalizer/BillingTypeNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
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): bool
public function supportsNormalization($data, $format = null, array $context = []): bool
{
return $data instanceof PrepaidBalanceInterface;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Api/ApigeeX/Normalizer/RatePlanNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Api/ApigeeX/Normalizer/RatePlanNormalizerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Api/ApigeeX/Normalizer/RatePlanRateNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Api/ApigeeX/Normalizer/StandardRatePlanNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Api/Management/Denormalizer/AppDenormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Api/Management/Normalizer/AppCredentialNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Api/Management/Normalizer/AppNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,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 CompanyMembership;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Api/Management/Query/StatsQueryNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Loading
Loading