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

Fixes for ParamNameMismatch error on composer analyze #399

Closed
wants to merge 3 commits into from
Closed
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
2 changes: 1 addition & 1 deletion src/Api/ApigeeX/Controller/AcceptedRatePlanController.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ protected function alterRequestPayload(array &$payload, AcceptedRatePlanInterfac
* @param array $query_params
* Additional query parameters.
*
* @return \Apigee\Edge\Api\ApigeeX\Entity\AcceptedRatePlanInterface[]
* @return AcceptedRatePlanInterface[]
*
* @psalm-suppress PossiblyNullArrayOffset - id() does not return null here.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ interface AcceptedRatePlanControllerInterface extends
/**
* Gets all accepted rate plans.
*
* @return \Apigee\Edge\Api\ApigeeX\Entity\AcceptedRatePlanInterface[]
* @return AcceptedRatePlanInterface[]
*/
public function getAllAcceptedRatePlans(): array;

Expand All @@ -45,7 +45,7 @@ public function getAllAcceptedRatePlans(): array;
* @param int|null $limit
* @param int $page
*
* @return \Apigee\Edge\Api\ApigeeX\Entity\AcceptedRatePlanInterface[]
* @return AcceptedRatePlanInterface[]
*/
public function getPaginatedAcceptedRatePlanList(?int $limit = null, int $page = 1): array;

Expand Down
4 changes: 2 additions & 2 deletions src/Api/ApigeeX/Controller/AppControllerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function listAppIds(?PagerInterface $pager = null): array;
* @param PagerInterface|null $pager
* Number of results to return.
*
* @return \Apigee\Edge\Api\Management\Entity\AppInterface[]
* @return AppInterface[]
* An array that can contain both developer- and appgroup app entities.
*/
public function listApps(bool $includeCredentials = false, ?PagerInterface $pager = null): array;
Expand Down Expand Up @@ -110,7 +110,7 @@ public function listAppIdsByStatus(string $status, ?PagerInterface $pager = null
* @param PagerInterface|null $pager
* Number of results to return.
*
* @return \Apigee\Edge\Api\Management\Entity\AppInterface[]
* @return AppInterface[]
* An array that can contain both developer- and appgroup app entities.
*/
public function listAppsByStatus(
Expand Down
2 changes: 1 addition & 1 deletion src/Api/ApigeeX/Controller/PrepaidBalanceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ abstract protected function getPrepaidBalanceEndpoint(): UriInterface;
*
* @param string|null $currencyCode
*
* @return \Apigee\Edge\Api\ApigeeX\Entity\PrepaidBalanceInterface[]
* @return PrepaidBalanceInterface[]
*
* @psalm-suppress PossiblyNullArrayOffset - id() does not return null here.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function topUpBalance($amount, $amountnano, string $currencyCode, string
/**
* Gets prepaid balances.
*
* @return \Apigee\Edge\Api\ApigeeX\Entity\PrepaidBalanceInterface[]
* @return PrepaidBalanceInterface[]
*/
public function getPrepaidBalance(): array;
}
4 changes: 2 additions & 2 deletions src/Api/ApigeeX/Denormalizer/RatePlanDenormalizerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ class RatePlanDenormalizerFactory implements DenormalizerInterface, SerializerAw
setSerializer as private traitSetSerializer;
}

/** @var \Symfony\Component\Serializer\Normalizer\DenormalizerInterface[] */
/** @var DenormalizerInterface[] */
protected $denormalizers = [];

/**
* RatePlanDenormalizerFactory constructor.
*
* @param \Symfony\Component\Serializer\Normalizer\DenormalizerInterface[] $denormalizers
* @param DenormalizerInterface[] $denormalizers
*/
public function __construct(array $denormalizers = [])
{
Expand Down
8 changes: 4 additions & 4 deletions src/Api/ApigeeX/Entity/RatePlan.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,16 @@ abstract class RatePlan extends Entity implements RatePlanInterface
*/
protected $package;

/** @var \Apigee\Edge\Api\ApigeeX\Structure\RatePlanXFee[] */
/** @var RatePlanXFee[] */
protected $ratePlanXFee = [];

/** @var \Apigee\Edge\Api\ApigeeX\Structure\FixedRecurringFee[] */
/** @var FixedRecurringFee[] */
protected $fixedRecurringFee = [];

/** @var \Apigee\Edge\Api\ApigeeX\Structure\ConsumptionPricingRate[] */
/** @var ConsumptionPricingRate[] */
protected $consumptionPricingRates = [];

/** @var \Apigee\Edge\Api\ApigeeX\Structure\RevenueShareRates[] */
/** @var RevenueShareRates[] */
protected $revenueShareRates = [];

/**
Expand Down
8 changes: 4 additions & 4 deletions src/Api/ApigeeX/Entity/RatePlanInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function getPackage(): ?ApiProductInterface;
public function setPackage(ApiProductInterface $package): void;

/**
* @return \Apigee\Edge\Api\ApigeeX\Structure\RatePlanXFee[]
* @return RatePlanXFee[]
*/
public function getRatePlanxFee(): array;

Expand All @@ -78,7 +78,7 @@ public function getRatePlanxFee(): array;
public function setRatePlanxFee(RatePlanXFee ...$ratePlanXFee): void;

/**
* @return \Apigee\Edge\Api\ApigeeX\Structure\FixedRecurringFee[]
* @return FixedRecurringFee[]
*/
public function getFixedRecurringFee(): array;

Expand All @@ -88,7 +88,7 @@ public function getFixedRecurringFee(): array;
public function setFixedRecurringFee(FixedRecurringFee ...$fixedRecurringFee): void;

/**
* @return \Apigee\Edge\Api\ApigeeX\Structure\ConsumptionPricingRate[]
* @return ConsumptionPricingRate[]
*/
public function getConsumptionPricingRates(): array;

Expand All @@ -98,7 +98,7 @@ public function getConsumptionPricingRates(): array;
public function setConsumptionPricingRates(ConsumptionPricingRate ...$consumptionPricingRates): void;

/**
* @return \Apigee\Edge\Api\ApigeeX\Structure\RevenueShareRates[]
* @return RevenueShareRates[]
*/
public function getRevenueShareRates(): array;

Expand Down
4 changes: 2 additions & 2 deletions src/Api/ApigeeX/Normalizer/AcceptedRatePlanNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ 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($data, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
{
/** @var AcceptedRatePlanInterface $object */
/** @var object $normalized */
$normalized = parent::normalize($object, $format, $context);
$normalized = parent::normalize($data, $format, $context);

return $normalized;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Api/ApigeeX/Normalizer/ApiProductNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ 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($data, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
{
$normalized = parent::normalize($object, $format, $context);
$normalized = parent::normalize($data, $format, $context);

return $normalized;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Api/ApigeeX/Normalizer/AppGroupMembershipNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ 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($data, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
{
$normalized = [];

/** @var AppGroupMembership $object */
foreach ($object->getMembers() as $member => $role) {
foreach ($data->getMembers() as $member => $role) {
$normalized[] = ['developer' => $member, 'roles' => $role];
}

Expand Down
4 changes: 2 additions & 2 deletions src/Api/ApigeeX/Normalizer/AppNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ public function supportsNormalization($data, $format = null, array $context = []
* @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($data, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
{
/** @var object $normalized */
$normalized = parent::normalize($object, $format, $context);
$normalized = parent::normalize($data, $format, $context);
// Remove properties that saved to attributes on apps.
unset($normalized->displayName);
unset($normalized->description);
Expand Down
4 changes: 2 additions & 2 deletions src/Api/ApigeeX/Normalizer/BillingTypeNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ 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($data, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
{
/** @var BillingTypeInterface $object */
/** @var object $normalized */
$normalized = parent::normalize($object, $format, $context);
$normalized = parent::normalize($data, $format, $context);

return $normalized;
}
Expand Down
10 changes: 5 additions & 5 deletions src/Api/ApigeeX/Normalizer/RatePlanNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@ 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($data, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
{
/** @var object $normalized */
$normalized = parent::normalize($object, $format, $context);
$normalized = parent::normalize($data, $format, $context);

// Fix the start- and end date of the rate plan if the organization's
// timezone is different from the default PHP timezone.
/** @var RatePlanInterface $object */
if (null === $object->getPackage()) {
throw new UninitializedPropertyException($object, 'package', 'Apigee\Edge\Api\ApigeeX\Entity\ApiProductInterface');
/** @var RatePlanInterface $data */
if (null === $data->getPackage()) {
throw new UninitializedPropertyException($data, 'package', 'Apigee\Edge\Api\ApigeeX\Entity\ApiProductInterface');
}

return $normalized;
Expand Down
10 changes: 5 additions & 5 deletions src/Api/ApigeeX/Normalizer/RatePlanNormalizerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ class RatePlanNormalizerFactory implements NormalizerInterface, SerializerAwareI
setSerializer as private traitSetSerializer;
}

/** @var \Symfony\Component\Serializer\Normalizer\NormalizerInterface[] */
/** @var NormalizerInterface[] */
protected $normalizers = [];

/**
* RatePlanDenormalizerFactory constructor.
*
* @param \Symfony\Component\Serializer\Normalizer\NormalizerInterface[] $normalizers
* @param NormalizerInterface[] $normalizers
*/
public function __construct(array $normalizers = [])
{
Expand All @@ -56,13 +56,13 @@ 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($data, $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
// denormalize this.
if ($normalizer->supportsNormalization($object, $format)) {
return $normalizer->normalize($object, $format, $context);
if ($normalizer->supportsNormalization($data, $format)) {
return $normalizer->normalize($data, $format, $context);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/Api/ApigeeX/Normalizer/RatePlanRateNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ 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($data, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
{
/** @var object $normalized */
$normalized = parent::normalize($object, $format, $context);
if ($object instanceof RatePlanRateRevShare) {
$normalized = parent::normalize($data, $format, $context);
if ($data instanceof RatePlanRateRevShare) {
$normalized->type = RatePlanRate::TYPE_REVSHARE;
} else {
$normalized->type = RatePlanRate::TYPE_RATECARD;
Expand Down
4 changes: 2 additions & 2 deletions src/Api/ApigeeX/Normalizer/StandardRatePlanNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ 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($data, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
{
/** @var object $normalized */
$normalized = parent::normalize($object, $format, $context);
$normalized = parent::normalize($data, $format, $context);
$normalized->type = RatePlanInterface::TYPE_STANDARD;

return $normalized;
Expand Down
4 changes: 2 additions & 2 deletions src/Api/Management/Controller/AppControllerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function listAppIds(?PagerInterface $pager = null): array;
* @param PagerInterface|null $pager
* Number of results to return.
*
* @return \Apigee\Edge\Api\Management\Entity\AppInterface[]
* @return AppInterface[]
* An array that can contain both developer- and company app entities.
*/
public function listApps(bool $includeCredentials = false, ?PagerInterface $pager = null): array;
Expand Down Expand Up @@ -110,7 +110,7 @@ public function listAppIdsByStatus(string $status, ?PagerInterface $pager = null
* @param PagerInterface|null $pager
* Number of results to return.
*
* @return \Apigee\Edge\Api\Management\Entity\AppInterface[]
* @return AppInterface[]
* An array that can contain both developer- and company app entities.
*/
public function listAppsByStatus(
Expand Down
2 changes: 1 addition & 1 deletion src/Api/Management/Entity/AppInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function getCallbackUrl(): ?string;
public function setCallbackUrl(string $callbackUrl): void;

/**
* @return \Apigee\Edge\Api\Management\Entity\AppCredentialInterface[]
* @return AppCredentialInterface[]
*/
public function getCredentials(): array;
}
4 changes: 2 additions & 2 deletions src/Api/Management/Normalizer/AppCredentialNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ public function supportsNormalization($data, $format = null, array $context = []
* @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($data, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
{
/** @var object $normalized */
$normalized = parent::normalize($object, $format, $context);
$normalized = parent::normalize($data, $format, $context);
// Taking special care of null as a credential's expiresAt property value.
// @see \Apigee\Edge\Api\Management\Entity\AppCredential::$expiresAt
if (!isset($normalized->expiresAt)) {
Expand Down
4 changes: 2 additions & 2 deletions src/Api/Management/Normalizer/AppNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ public function supportsNormalization($data, $format = null, array $context = []
* @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($data, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
{
/** @var object $normalized */
$normalized = parent::normalize($object, $format, $context);
$normalized = parent::normalize($data, $format, $context);
// Remove properties that saved to attributes on apps.
unset($normalized->displayName);
unset($normalized->description);
Expand Down
8 changes: 4 additions & 4 deletions src/Api/Management/Normalizer/CompanyMembershipNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ 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($data, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
{
$normalized = [
'developer' => [],
];
/** @var CompanyMembership $object */
foreach ($object->getMembers() as $member => $role) {
/** @var CompanyMembership $data */
foreach ($data->getMembers() as $member => $role) {
$normalized['developer'][] = (object) ['email' => $member, 'role' => $role];
}

// convert to ArrayObject as symfony normalizer throws error for std object.
// 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);
}
Expand Down
Loading
Loading