Skip to content

Commit b2299d3

Browse files
fixes styling issue
1 parent 4a044c0 commit b2299d3

45 files changed

Lines changed: 190 additions & 156 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/Api/ApigeeX/Controller/PaginationHelperTrait.php

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -112,46 +112,45 @@ protected function listEntities(?PagerInterface $pager = null, array $query_para
112112
$responseArray = reset($responseArray);
113113

114114
return $this->responseArrayToArrayOfEntities($responseArray, $key_provider);
115-
} else {
116-
// Default page size set to 1000, because the AppGroupApps endpoint
117-
// does not return nextPageToken unless a pageSize is specified
118-
// in the request parameters.
119-
$pageSize = 1000;
120-
// Pass an empty pager to load all entities.
121-
$responseArray = $this->getResultsInRange($this->createPager($pageSize), $query_params);
122-
// Check flag 'nextPageToken' to get next items from the list.
123-
$nextPageToken = array_key_exists('nextPageToken', $responseArray) ? $responseArray['nextPageToken'] : false;
124-
// Ignore entity type key from response, ex.: developer, apiproduct,
125-
// etc.
126-
$responseArray = reset($responseArray);
127-
// Appgroup can be empty.
128-
if (empty($responseArray) || !is_array($responseArray)) {
129-
return [];
130-
}
131-
$entities = $this->responseArrayToArrayOfEntities($responseArray, $key_provider);
132-
133-
if ($nextPageToken) {
134-
do {
135-
$tmp = $this->getResultsInRange($this->createPager($pageSize, $nextPageToken), $query_params);
136-
// Check the flag 'nextPageToken' to get next items from the list.
137-
$nextPageToken = array_key_exists('nextPageToken', $tmp) ? $tmp['nextPageToken'] : false;
138-
// Ignore entity type key from response, ex.: developer,
139-
// apiproduct, etc.
140-
$tmp = reset($tmp);
141-
// Remove the first item from the list because it is the same
142-
// as the last item of $entities at this moment.
143-
// Apigee X response always starts with the requested entity
144-
// (pageToken).
145-
array_shift($tmp);
146-
$tmpEntities = $this->responseArrayToArrayOfEntities($tmp, $key_provider);
147-
// The returned entity array is keyed by entity id which
148-
// is unique so we can do this.
149-
$entities += $tmpEntities;
150-
} while ($nextPageToken);
151-
}
152-
153-
return $entities;
154115
}
116+
// Default page size set to 1000, because the AppGroupApps endpoint
117+
// does not return nextPageToken unless a pageSize is specified
118+
// in the request parameters.
119+
$pageSize = 1000;
120+
// Pass an empty pager to load all entities.
121+
$responseArray = $this->getResultsInRange($this->createPager($pageSize), $query_params);
122+
// Check flag 'nextPageToken' to get next items from the list.
123+
$nextPageToken = array_key_exists('nextPageToken', $responseArray) ? $responseArray['nextPageToken'] : false;
124+
// Ignore entity type key from response, ex.: developer, apiproduct,
125+
// etc.
126+
$responseArray = reset($responseArray);
127+
// Appgroup can be empty.
128+
if (empty($responseArray) || !is_array($responseArray)) {
129+
return [];
130+
}
131+
$entities = $this->responseArrayToArrayOfEntities($responseArray, $key_provider);
132+
133+
if ($nextPageToken) {
134+
do {
135+
$tmp = $this->getResultsInRange($this->createPager($pageSize, $nextPageToken), $query_params);
136+
// Check the flag 'nextPageToken' to get next items from the list.
137+
$nextPageToken = array_key_exists('nextPageToken', $tmp) ? $tmp['nextPageToken'] : false;
138+
// Ignore entity type key from response, ex.: developer,
139+
// apiproduct, etc.
140+
$tmp = reset($tmp);
141+
// Remove the first item from the list because it is the same
142+
// as the last item of $entities at this moment.
143+
// Apigee X response always starts with the requested entity
144+
// (pageToken).
145+
array_shift($tmp);
146+
$tmpEntities = $this->responseArrayToArrayOfEntities($tmp, $key_provider);
147+
// The returned entity array is keyed by entity id which
148+
// is unique so we can do this.
149+
$entities += $tmpEntities;
150+
} while ($nextPageToken);
151+
}
152+
153+
return $entities;
155154
}
156155

157156
/**

src/Api/ApigeeX/NameConverter/RatePlanNameConverter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
* Maps rate plan properties from the API response to their destination properties.
2626
*
2727
* @see \Apigee\Edge\Api\ApigeeX\Entity\RatePlan
28+
*
2829
* @psalm-suppress ClassMustBeFinal
2930
*/
3031
class RatePlanNameConverter extends NameConverterBase implements NameConverterInterface

src/Api/ApigeeX/Normalizer/AcceptedRatePlanNormalizer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use Apigee\Edge\Api\ApigeeX\Entity\AcceptedRatePlanInterface;
2222
use Apigee\Edge\Api\Monetization\Normalizer\EntityNormalizer;
2323
use Apigee\Edge\Api\Monetization\Utility\TimezoneFixerHelperTrait;
24+
use ArrayObject;
2425

2526
/**
2627
* @psalm-suppress ClassMustBeFinal
@@ -35,7 +36,7 @@ class AcceptedRatePlanNormalizer extends EntityNormalizer
3536
* @psalm-suppress InvalidReturnType Returning an object here is required
3637
* for creating a valid Apigee Edge request.
3738
*/
38-
public function normalize($data, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
39+
public function normalize($data, $format = null, array $context = []): array|string|int|float|bool|ArrayObject|null
3940
{
4041
/** @var AcceptedRatePlanInterface $data */
4142
/** @var object $normalized */

src/Api/ApigeeX/Normalizer/ApiProductNormalizer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use Apigee\Edge\Api\ApigeeX\Entity\ApiProductInterface;
2222
use Apigee\Edge\Api\Monetization\NameConverter\ApiPackageNameConverter;
2323
use Apigee\Edge\Api\Monetization\Normalizer\EntityNormalizer;
24+
use ArrayObject;
2425
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
2526
use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface;
2627
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
@@ -48,7 +49,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory
4849
* @psalm-suppress InvalidReturnType Returning an object here is required
4950
* for creating a valid Apigee Edge request.
5051
*/
51-
public function normalize($data, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
52+
public function normalize($data, $format = null, array $context = []): array|string|int|float|bool|ArrayObject|null
5253
{
5354
$normalized = parent::normalize($data, $format, $context);
5455

src/Api/ApigeeX/Normalizer/AppGroupMembershipNormalizer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
namespace Apigee\Edge\Api\ApigeeX\Normalizer;
2020

2121
use Apigee\Edge\Api\ApigeeX\Structure\AppGroupMembership;
22+
use ArrayObject;
2223
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
2324

2425
final class AppGroupMembershipNormalizer implements NormalizerInterface
@@ -29,7 +30,7 @@ final class AppGroupMembershipNormalizer implements NormalizerInterface
2930
* @psalm-suppress InvalidReturnType Returning an object here is required
3031
* for creating a valid Apigee Edge request.
3132
*/
32-
public function normalize($data, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
33+
public function normalize($data, $format = null, array $context = []): array|string|int|float|bool|ArrayObject|null
3334
{
3435
$normalized = [];
3536

src/Api/ApigeeX/Normalizer/AppNormalizer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
use Apigee\Edge\Api\Management\Entity\AppInterface;
2222
use Apigee\Edge\Normalizer\ObjectNormalizer;
23+
use ArrayObject;
2324
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
2425

2526
/**
@@ -41,7 +42,7 @@ public function supportsNormalization($data, $format = null, array $context = []
4142
* @psalm-suppress InvalidReturnType Returning an object here is required
4243
* for creating a valid Apigee Edge request.
4344
*/
44-
public function normalize($data, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
45+
public function normalize($data, $format = null, array $context = []): array|string|int|float|bool|ArrayObject|null
4546
{
4647
/** @var object $normalized */
4748
$normalized = parent::normalize($data, $format, $context);

src/Api/ApigeeX/Normalizer/BillingTypeNormalizer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
use Apigee\Edge\Api\ApigeeX\Entity\BillingTypeInterface;
2222
use Apigee\Edge\Api\Monetization\Normalizer\EntityNormalizer;
23+
use ArrayObject;
2324

2425
final class BillingTypeNormalizer extends EntityNormalizer
2526
{
@@ -29,7 +30,7 @@ final class BillingTypeNormalizer extends EntityNormalizer
2930
* @psalm-suppress InvalidReturnType Returning an object here is required
3031
* for creating a valid Apigee Edge request.
3132
*/
32-
public function normalize($data, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
33+
public function normalize($data, $format = null, array $context = []): array|string|int|float|bool|ArrayObject|null
3334
{
3435
/** @var BillingTypeInterface $data */
3536
/** @var object $normalized */

src/Api/ApigeeX/Normalizer/RatePlanNormalizer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
use Apigee\Edge\Api\Monetization\Normalizer\EntityNormalizer;
2424
use Apigee\Edge\Api\Monetization\Utility\TimezoneFixerHelperTrait;
2525
use Apigee\Edge\Exception\UninitializedPropertyException;
26+
use ArrayObject;
2627
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
2728
use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface;
2829
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
@@ -52,7 +53,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory
5253
* @psalm-suppress InvalidReturnType Returning an object here is required
5354
* for creating a valid Apigee Edge request.
5455
*/
55-
public function normalize($data, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
56+
public function normalize($data, $format = null, array $context = []): array|string|int|float|bool|ArrayObject|null
5657
{
5758
/** @var object $normalized */
5859
$normalized = parent::normalize($data, $format, $context);

src/Api/ApigeeX/Normalizer/RatePlanNormalizerFactory.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use Apigee\Edge\Api\Monetization\Normalizer\CompanyRatePlanNormalizer;
2222
use Apigee\Edge\Api\Monetization\Normalizer\DeveloperCategoryRatePlanNormalizer;
2323
use Apigee\Edge\Api\Monetization\Normalizer\DeveloperRatePlanNormalizer;
24+
use ArrayObject;
2425
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
2526
use Symfony\Component\Serializer\SerializerAwareInterface;
2627
use Symfony\Component\Serializer\SerializerAwareTrait;
@@ -56,7 +57,7 @@ public function __construct(array $normalizers = [])
5657
* @psalm-suppress InvalidNullableReturnType - There are going to be at
5758
* least one normalizer always that can normalize data here.
5859
*/
59-
public function normalize($data, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
60+
public function normalize($data, $format = null, array $context = []): array|string|int|float|bool|ArrayObject|null
6061
{
6162
foreach ($this->normalizers as $normalizer) {
6263
// Return the result from the first denormalizer that can

src/Api/ApigeeX/Normalizer/RatePlanRateNormalizer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use Apigee\Edge\Api\Monetization\Structure\RatePlanRate;
2222
use Apigee\Edge\Api\Monetization\Structure\RatePlanRateRevShare;
2323
use Apigee\Edge\Normalizer\ObjectNormalizer;
24+
use ArrayObject;
2425

2526
final class RatePlanRateNormalizer extends ObjectNormalizer
2627
{
@@ -30,7 +31,7 @@ final class RatePlanRateNormalizer extends ObjectNormalizer
3031
* @psalm-suppress InvalidReturnType Returning an object here is required
3132
* for creating a valid Apigee Edge request.
3233
*/
33-
public function normalize($data, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
34+
public function normalize($data, $format = null, array $context = []): array|string|int|float|bool|ArrayObject|null
3435
{
3536
/** @var object $normalized */
3637
$normalized = parent::normalize($data, $format, $context);

0 commit comments

Comments
 (0)