diff --git a/.github/workflows/php-test-workflow.yml b/.github/workflows/php-test-workflow.yml
index b1c2b78ee..75bfcb3fe 100644
--- a/.github/workflows/php-test-workflow.yml
+++ b/.github/workflows/php-test-workflow.yml
@@ -19,6 +19,14 @@ jobs:
dependencies-preference: " "
- php: '8.3'
dependencies-preference: "--prefer-lowest"
+ - php: '8.4'
+ dependencies-preference: " "
+ - php: '8.4'
+ dependencies-preference: "--prefer-lowest"
+ - php: '8.5'
+ dependencies-preference: " "
+ - php: '8.5'
+ dependencies-preference: "--prefer-lowest"
fail-fast: false
steps:
- uses: actions/checkout@v4
diff --git a/composer.json b/composer.json
index d5a264482..b49e6e124 100644
--- a/composer.json
+++ b/composer.json
@@ -13,7 +13,7 @@
"homepage": "http://github.com/apigee/apigee-client-php",
"license": "Apache-2.0",
"require": {
- "php": "~8.2 || ~8.3",
+ "php": "~8.2 || ~8.3 || ~8.4 || ~8.5",
"ext-json": "*",
"ext-openssl": "*",
"ext-reflection": "*",
@@ -28,14 +28,15 @@
"php-http/message-factory": "^1.0",
"phpdocumentor/reflection-docblock": "^5.0",
"psr/http-message": "^1.0 || ^2.0",
- "symfony/options-resolver": "^7.4.0",
- "symfony/property-access": "^7.4.4",
- "symfony/property-info": "^7.4.0",
- "symfony/serializer": "^7.3.0"
+ "symfony/options-resolver": "^7.4.8",
+ "symfony/property-access": "^7.4.8",
+ "symfony/property-info": "^7.4.8",
+ "symfony/serializer": "^7.4.8",
+ "guzzlehttp/promises": "^2.0.3"
},
"require-dev": {
"dms/phpunit-arraysubset-asserts": "^0.4.0",
- "friendsofphp/php-cs-fixer": "^3.68",
+ "friendsofphp/php-cs-fixer": "^3.80",
"fzaninotto/faker": "^1.7",
"guzzlehttp/psr7": "^2.5",
"league/flysystem": "^1.0",
@@ -46,10 +47,27 @@
"phpmetrics/phpmetrics": "^2.7",
"phpunit/phpunit": "^9.6",
"sebastian/comparator": "^4.0.5",
- "symfony/cache": "^7.3.0",
- "symfony/type-info": "^7.3.0",
- "symfony/var-exporter": "^7.3.0",
- "vimeo/psalm": "^5.20"
+ "symfony/cache": "^7.4.8",
+ "symfony/type-info": "^7.4.8",
+ "symfony/var-exporter": "^7.4.8",
+ "vimeo/psalm": "^6.14.0",
+ "amphp/amp": "^3.1.1",
+ "amphp/byte-stream": "^2.1.2",
+ "amphp/cache": "^2.0.1",
+ "amphp/dns": "^2.4.1",
+ "amphp/parallel": "^2.3.3",
+ "amphp/parser": "^1.1.1",
+ "amphp/socket": "^2.4.0",
+ "daverandom/libdns": "^2.1.0",
+ "symfony/console": "^6.4.36 || ^7.0",
+ "spatie/array-to-xml": "^3.4.4",
+ "nikic/php-parser": "^5.7.0",
+ "amphp/pipeline": "^1.2.3",
+ "amphp/process": "^2.0.3",
+ "amphp/serialization": "^1.1.0",
+ "amphp/sync": "^2.0",
+ "revolt/event-loop": "^1.1.0",
+ "symfony/filesystem": "^7.4.8"
},
"autoload": {
"psr-4": {
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index 087b02a20..f6d012d9f 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -1,5 +1,4 @@
-
-
-
-
-
-
+
-
-
-
- tests/
-
-
-
-
- ./src
-
-
+
+
+
+ tests/
+
+
diff --git a/psalm.xml.dist b/psalm.xml.dist
index 065e811dd..789f61c80 100644
--- a/psalm.xml.dist
+++ b/psalm.xml.dist
@@ -7,7 +7,7 @@
allowStringToStandInForClass="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
- xsi:schemaLocation="https://getpsalm.org/schema/config file:///var/www/html/vendor/vimeo/psalm/config.xsd"
+ xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
@@ -54,6 +54,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Api/ApigeeX/Controller/AcceptedRatePlanController.php b/src/Api/ApigeeX/Controller/AcceptedRatePlanController.php
index d73577dee..23df4fa88 100755
--- a/src/Api/ApigeeX/Controller/AcceptedRatePlanController.php
+++ b/src/Api/ApigeeX/Controller/AcceptedRatePlanController.php
@@ -89,7 +89,7 @@ public function acceptRatePlan(RatePlanInterface $ratePlan): AcceptedRatePlanInt
$tmp = json_decode($payload, true);
- $payload = json_encode($tmp);
+ $payload = (string) json_encode($tmp);
$response = $this->client->post($this->getBaseEndpointUri(), $payload);
$this->getEntitySerializer()->setPropertiesFromResponse($response, $acceptedRatePlan);
diff --git a/src/Api/ApigeeX/Controller/ApiProductController.php b/src/Api/ApigeeX/Controller/ApiProductController.php
index 696eb99a9..7a2dd7439 100755
--- a/src/Api/ApigeeX/Controller/ApiProductController.php
+++ b/src/Api/ApigeeX/Controller/ApiProductController.php
@@ -30,7 +30,7 @@
use Apigee\Edge\Serializer\EntitySerializerInterface;
use Psr\Http\Message\UriInterface;
-class ApiProductController extends OrganizationAwareEntityController implements ApiProductControllerInterface
+final class ApiProductController extends OrganizationAwareEntityController implements ApiProductControllerInterface
{
use EntityCreateOperationControllerTrait;
use EntityDeleteOperationControllerTrait;
@@ -134,7 +134,7 @@ private function getEligibleProducts(string $type, string $entityId): array
}
}
- $current_ms = substr((string) (microtime(true) * 1000), 0);
+ $current_ms = substr((string) (microtime(true) * 1000.0), 0);
foreach ($this->getAvailablexApiProducts($type, $entityId, true) as $item) {
// Create a new rate plan controller.
diff --git a/src/Api/ApigeeX/Controller/AppController.php b/src/Api/ApigeeX/Controller/AppController.php
index 0989a9c2f..71735b24e 100644
--- a/src/Api/ApigeeX/Controller/AppController.php
+++ b/src/Api/ApigeeX/Controller/AppController.php
@@ -32,7 +32,7 @@
/**
* Class AppController.
*/
-class AppController extends PaginatedEntityController implements AppControllerInterface
+final class AppController extends PaginatedEntityController implements AppControllerInterface
{
use EntityListingControllerTrait;
use PaginationHelperTrait {
diff --git a/src/Api/ApigeeX/Controller/AppGroupAppController.php b/src/Api/ApigeeX/Controller/AppGroupAppController.php
index c508a4ece..80551350b 100644
--- a/src/Api/ApigeeX/Controller/AppGroupAppController.php
+++ b/src/Api/ApigeeX/Controller/AppGroupAppController.php
@@ -30,7 +30,7 @@
/**
* Class AppGroupAppController.
*/
-class AppGroupAppController extends AppByOwnerController implements AppGroupAppControllerInterface
+final class AppGroupAppController extends AppByOwnerController implements AppGroupAppControllerInterface
{
use AppGroupAwareControllerTrait;
diff --git a/src/Api/ApigeeX/Controller/AppGroupAppCredentialController.php b/src/Api/ApigeeX/Controller/AppGroupAppCredentialController.php
index a9419a7ec..530a7ad28 100644
--- a/src/Api/ApigeeX/Controller/AppGroupAppCredentialController.php
+++ b/src/Api/ApigeeX/Controller/AppGroupAppCredentialController.php
@@ -27,7 +27,7 @@
/**
* Class AppGroupAppCredentialController.
*/
-class AppGroupAppCredentialController extends CompanyAppCredentialController
+final class AppGroupAppCredentialController extends CompanyAppCredentialController
{
/** @var string appgroup name. */
protected $appGroup;
diff --git a/src/Api/ApigeeX/Controller/AppGroupController.php b/src/Api/ApigeeX/Controller/AppGroupController.php
index c53cb26a6..ca262d325 100644
--- a/src/Api/ApigeeX/Controller/AppGroupController.php
+++ b/src/Api/ApigeeX/Controller/AppGroupController.php
@@ -33,7 +33,7 @@
/**
* Class AppGroupController.
*/
-class AppGroupController extends PaginatedEntityController implements AppGroupControllerInterface
+final class AppGroupController extends PaginatedEntityController implements AppGroupControllerInterface
{
use AttributesAwareEntityControllerTrait;
use EntityCrudOperationsControllerTrait;
diff --git a/src/Api/ApigeeX/Controller/AppGroupMembersController.php b/src/Api/ApigeeX/Controller/AppGroupMembersController.php
index d96cbe557..3c60570e7 100644
--- a/src/Api/ApigeeX/Controller/AppGroupMembersController.php
+++ b/src/Api/ApigeeX/Controller/AppGroupMembersController.php
@@ -30,7 +30,7 @@
/**
* Allows to manage appgroup memberships.
*/
-class AppGroupMembersController extends AbstractController implements AppGroupMembersControllerInterface
+final class AppGroupMembersController extends AbstractController implements AppGroupMembersControllerInterface
{
use AppGroupAwareControllerTrait;
use OrganizationAwareControllerTrait;
diff --git a/src/Api/ApigeeX/Controller/DeveloperAcceptedRatePlanController.php b/src/Api/ApigeeX/Controller/DeveloperAcceptedRatePlanController.php
index 60ba2ed9e..6967a2af5 100755
--- a/src/Api/ApigeeX/Controller/DeveloperAcceptedRatePlanController.php
+++ b/src/Api/ApigeeX/Controller/DeveloperAcceptedRatePlanController.php
@@ -25,7 +25,7 @@
use Apigee\Edge\Serializer\EntitySerializerInterface;
use Psr\Http\Message\UriInterface;
-class DeveloperAcceptedRatePlanController extends AcceptedRatePlanController
+final class DeveloperAcceptedRatePlanController extends AcceptedRatePlanController
{
/**
* UUID or email address of a developer.
diff --git a/src/Api/ApigeeX/Controller/DeveloperBillingTypeController.php b/src/Api/ApigeeX/Controller/DeveloperBillingTypeController.php
index c43981bce..7f1095075 100644
--- a/src/Api/ApigeeX/Controller/DeveloperBillingTypeController.php
+++ b/src/Api/ApigeeX/Controller/DeveloperBillingTypeController.php
@@ -23,7 +23,7 @@
use Apigee\Edge\Serializer\EntitySerializerInterface;
use Psr\Http\Message\UriInterface;
-class DeveloperBillingTypeController extends BillingTypeController
+final class DeveloperBillingTypeController extends BillingTypeController
{
/**
* Email address of a developer.
diff --git a/src/Api/ApigeeX/Controller/DeveloperPrepaidBalanceController.php b/src/Api/ApigeeX/Controller/DeveloperPrepaidBalanceController.php
index e0f4fb347..bb82569aa 100644
--- a/src/Api/ApigeeX/Controller/DeveloperPrepaidBalanceController.php
+++ b/src/Api/ApigeeX/Controller/DeveloperPrepaidBalanceController.php
@@ -22,7 +22,7 @@
use Apigee\Edge\Serializer\EntitySerializerInterface;
use Psr\Http\Message\UriInterface;
-class DeveloperPrepaidBalanceController extends PrepaidBalanceController implements DeveloperPrepaidBalanceControllerInterface
+final class DeveloperPrepaidBalanceController extends PrepaidBalanceController implements DeveloperPrepaidBalanceControllerInterface
{
/**
* Email address of a developer.
diff --git a/src/Api/ApigeeX/Controller/PaginationHelperTrait.php b/src/Api/ApigeeX/Controller/PaginationHelperTrait.php
index 87fd0c153..976c9fd99 100644
--- a/src/Api/ApigeeX/Controller/PaginationHelperTrait.php
+++ b/src/Api/ApigeeX/Controller/PaginationHelperTrait.php
@@ -112,46 +112,45 @@ protected function listEntities(?PagerInterface $pager = null, array $query_para
$responseArray = reset($responseArray);
return $this->responseArrayToArrayOfEntities($responseArray, $key_provider);
- } else {
- // Default page size set to 1000, because the AppGroupApps endpoint
- // does not return nextPageToken unless a pageSize is specified
- // in the request parameters.
- $pageSize = 1000;
- // Pass an empty pager to load all entities.
- $responseArray = $this->getResultsInRange($this->createPager($pageSize), $query_params);
- // Check flag 'nextPageToken' to get next items from the list.
- $nextPageToken = array_key_exists('nextPageToken', $responseArray) ? $responseArray['nextPageToken'] : false;
- // Ignore entity type key from response, ex.: developer, apiproduct,
- // etc.
- $responseArray = reset($responseArray);
- // Appgroup can be empty.
- if (empty($responseArray) || !is_array($responseArray)) {
- return [];
- }
- $entities = $this->responseArrayToArrayOfEntities($responseArray, $key_provider);
-
- if ($nextPageToken) {
- do {
- $tmp = $this->getResultsInRange($this->createPager($pageSize, $nextPageToken), $query_params);
- // Check the flag 'nextPageToken' to get next items from the list.
- $nextPageToken = array_key_exists('nextPageToken', $tmp) ? $tmp['nextPageToken'] : false;
- // Ignore entity type key from response, ex.: developer,
- // apiproduct, etc.
- $tmp = reset($tmp);
- // Remove the first item from the list because it is the same
- // as the last item of $entities at this moment.
- // Apigee X response always starts with the requested entity
- // (pageToken).
- array_shift($tmp);
- $tmpEntities = $this->responseArrayToArrayOfEntities($tmp, $key_provider);
- // The returned entity array is keyed by entity id which
- // is unique so we can do this.
- $entities += $tmpEntities;
- } while ($nextPageToken);
- }
-
- return $entities;
}
+ // Default page size set to 1000, because the AppGroupApps endpoint
+ // does not return nextPageToken unless a pageSize is specified
+ // in the request parameters.
+ $pageSize = 1000;
+ // Pass an empty pager to load all entities.
+ $responseArray = $this->getResultsInRange($this->createPager($pageSize), $query_params);
+ // Check flag 'nextPageToken' to get next items from the list.
+ $nextPageToken = array_key_exists('nextPageToken', $responseArray) ? $responseArray['nextPageToken'] : false;
+ // Ignore entity type key from response, ex.: developer, apiproduct,
+ // etc.
+ $responseArray = reset($responseArray);
+ // Appgroup can be empty.
+ if (empty($responseArray) || !is_array($responseArray)) {
+ return [];
+ }
+ $entities = $this->responseArrayToArrayOfEntities($responseArray, $key_provider);
+
+ if ($nextPageToken) {
+ do {
+ $tmp = $this->getResultsInRange($this->createPager($pageSize, $nextPageToken), $query_params);
+ // Check the flag 'nextPageToken' to get next items from the list.
+ $nextPageToken = array_key_exists('nextPageToken', $tmp) ? $tmp['nextPageToken'] : false;
+ // Ignore entity type key from response, ex.: developer,
+ // apiproduct, etc.
+ $tmp = reset($tmp);
+ // Remove the first item from the list because it is the same
+ // as the last item of $entities at this moment.
+ // Apigee X response always starts with the requested entity
+ // (pageToken).
+ array_shift($tmp);
+ $tmpEntities = $this->responseArrayToArrayOfEntities($tmp, $key_provider);
+ // The returned entity array is keyed by entity id which
+ // is unique so we can do this.
+ $entities += $tmpEntities;
+ } while ($nextPageToken);
+ }
+
+ return $entities;
}
/**
diff --git a/src/Api/ApigeeX/Controller/RatePlanController.php b/src/Api/ApigeeX/Controller/RatePlanController.php
index bb5f414f8..59412700c 100755
--- a/src/Api/ApigeeX/Controller/RatePlanController.php
+++ b/src/Api/ApigeeX/Controller/RatePlanController.php
@@ -30,7 +30,7 @@
use Apigee\Edge\Serializer\EntitySerializerInterface;
use Psr\Http\Message\UriInterface;
-class RatePlanController extends OrganizationAwareEntityController implements RatePlanControllerInterface
+final class RatePlanController extends OrganizationAwareEntityController implements RatePlanControllerInterface
{
use EntityCrudOperationsControllerTrait {
buildEntityCreatePayload as private traitBuildContextForEntityTransformerInCreate;
@@ -92,7 +92,7 @@ public function getEntities(?bool $showCurrentOnly = null, ?bool $showPrivate =
public function createNewRevision(RatePlanRevisionInterface $entity): void
{
$payload = $this->getEntitySerializer()->serialize($entity, 'json');
- $response = $this->getClient()->post($this->getEntityEndpointUri($entity->getPreviousRatePlanRevision()->id()) . '/revision', $payload);
+ $response = $this->getClient()->post((string) $this->getEntityEndpointUri($entity->getPreviousRatePlanRevision()->id()) . '/revision', $payload);
$this->getEntitySerializer()->setPropertiesFromResponse($response, $entity);
}
diff --git a/src/Api/ApigeeX/Controller/SupportedCurrencyController.php b/src/Api/ApigeeX/Controller/SupportedCurrencyController.php
index eda454151..1a46d90c4 100644
--- a/src/Api/ApigeeX/Controller/SupportedCurrencyController.php
+++ b/src/Api/ApigeeX/Controller/SupportedCurrencyController.php
@@ -23,7 +23,7 @@
use Apigee\Edge\Controller\EntityListingControllerTrait;
use Psr\Http\Message\UriInterface;
-class SupportedCurrencyController extends EntityController implements SupportedCurrencyControllerInterface
+final class SupportedCurrencyController extends EntityController implements SupportedCurrencyControllerInterface
{
use EntityListingControllerTrait;
diff --git a/src/Api/ApigeeX/Denormalizer/AcceptedRatePlanDenormalizer.php b/src/Api/ApigeeX/Denormalizer/AcceptedRatePlanDenormalizer.php
index ebc4e9101..663df8570 100755
--- a/src/Api/ApigeeX/Denormalizer/AcceptedRatePlanDenormalizer.php
+++ b/src/Api/ApigeeX/Denormalizer/AcceptedRatePlanDenormalizer.php
@@ -50,6 +50,6 @@ public function supportsDenormalization($data, $type, $format = null, array $con
return false;
}
- return AcceptedRatePlanInterface::class === $type || $type instanceof AcceptedRatePlanInterface || in_array(AcceptedRatePlanInterface::class, class_implements($type));
+ return AcceptedRatePlanInterface::class === $type || $type instanceof AcceptedRatePlanInterface || in_array(AcceptedRatePlanInterface::class, class_implements($type) ?: []);
}
}
diff --git a/src/Api/ApigeeX/Denormalizer/ApiProductDenormalizer.php b/src/Api/ApigeeX/Denormalizer/ApiProductDenormalizer.php
index 17b950fb8..56fa902fd 100755
--- a/src/Api/ApigeeX/Denormalizer/ApiProductDenormalizer.php
+++ b/src/Api/ApigeeX/Denormalizer/ApiProductDenormalizer.php
@@ -26,7 +26,7 @@
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class ApiProductDenormalizer extends ObjectDenormalizer
+final class ApiProductDenormalizer extends ObjectDenormalizer
{
/**
* ApiProductDenormalizer constructor.
@@ -52,6 +52,6 @@ public function supportsDenormalization($data, $type, $format = null, array $con
return false;
}
- return ApiProductInterface::class === $type || $type instanceof ApiProductInterface || in_array(ApiProductInterface::class, class_implements($type));
+ return ApiProductInterface::class === $type || $type instanceof ApiProductInterface || in_array(ApiProductInterface::class, class_implements($type) ?: []);
}
}
diff --git a/src/Api/ApigeeX/Denormalizer/AppDenormalizer.php b/src/Api/ApigeeX/Denormalizer/AppDenormalizer.php
index 63be5b096..6bf051c28 100644
--- a/src/Api/ApigeeX/Denormalizer/AppDenormalizer.php
+++ b/src/Api/ApigeeX/Denormalizer/AppDenormalizer.php
@@ -27,7 +27,7 @@
/**
* Dynamically denormalizes apps to developer- or appgroup apps.
*/
-class AppDenormalizer extends ObjectDenormalizer
+final class AppDenormalizer extends ObjectDenormalizer
{
/**
* Fully qualified class name of the developer app entity.
@@ -68,7 +68,7 @@ public function supportsDenormalization($data, $type, $format = null, array $con
return false;
}
- return AppInterface::class === $type || $type instanceof AppInterface || in_array(AppInterface::class, class_implements($type));
+ return AppInterface::class === $type || $type instanceof AppInterface || in_array(AppInterface::class, class_implements($type) ?: []);
}
/**
diff --git a/src/Api/ApigeeX/Denormalizer/AppGroupMembershipDenormalizer.php b/src/Api/ApigeeX/Denormalizer/AppGroupMembershipDenormalizer.php
index 47117e15d..aecda2e04 100644
--- a/src/Api/ApigeeX/Denormalizer/AppGroupMembershipDenormalizer.php
+++ b/src/Api/ApigeeX/Denormalizer/AppGroupMembershipDenormalizer.php
@@ -24,7 +24,7 @@
/**
* Denormalizes appgroup membership data.
*/
-class AppGroupMembershipDenormalizer implements DenormalizerInterface
+final class AppGroupMembershipDenormalizer implements DenormalizerInterface
{
/**
* {@inheritdoc}
diff --git a/src/Api/ApigeeX/Denormalizer/BillingTypeDenormalizer.php b/src/Api/ApigeeX/Denormalizer/BillingTypeDenormalizer.php
index f5e73ca1d..1b5e168d0 100644
--- a/src/Api/ApigeeX/Denormalizer/BillingTypeDenormalizer.php
+++ b/src/Api/ApigeeX/Denormalizer/BillingTypeDenormalizer.php
@@ -44,6 +44,6 @@ public function supportsDenormalization($data, $type, $format = null, array $con
return false;
}
- return BillingTypeInterface::class === $type || $type instanceof BillingTypeInterface || in_array(BillingTypeInterface::class, class_implements($type));
+ return BillingTypeInterface::class === $type || $type instanceof BillingTypeInterface || in_array(BillingTypeInterface::class, class_implements($type) ?: []);
}
}
diff --git a/src/Api/ApigeeX/Denormalizer/DeveloperAcceptedRatePlanDenormalizer.php b/src/Api/ApigeeX/Denormalizer/DeveloperAcceptedRatePlanDenormalizer.php
index 9f356a179..4377aeab2 100755
--- a/src/Api/ApigeeX/Denormalizer/DeveloperAcceptedRatePlanDenormalizer.php
+++ b/src/Api/ApigeeX/Denormalizer/DeveloperAcceptedRatePlanDenormalizer.php
@@ -20,7 +20,7 @@
use Apigee\Edge\Api\ApigeeX\Entity\DeveloperAcceptedRatePlan;
-class DeveloperAcceptedRatePlanDenormalizer extends AcceptedRatePlanDenormalizer
+final class DeveloperAcceptedRatePlanDenormalizer extends AcceptedRatePlanDenormalizer
{
/**
* Fully qualified class name of the developer accepted rate plan entity.
diff --git a/src/Api/ApigeeX/Denormalizer/DeveloperBillingTypeDenormalizer.php b/src/Api/ApigeeX/Denormalizer/DeveloperBillingTypeDenormalizer.php
index 4c3278f31..94460c665 100644
--- a/src/Api/ApigeeX/Denormalizer/DeveloperBillingTypeDenormalizer.php
+++ b/src/Api/ApigeeX/Denormalizer/DeveloperBillingTypeDenormalizer.php
@@ -20,7 +20,7 @@
use Apigee\Edge\Api\ApigeeX\Entity\DeveloperBillingType;
-class DeveloperBillingTypeDenormalizer extends BillingTypeDenormalizer
+final class DeveloperBillingTypeDenormalizer extends BillingTypeDenormalizer
{
/**
* Fully qualified class name of the developer billing type.
diff --git a/src/Api/ApigeeX/Denormalizer/PrepaidBalanceDenormalizer.php b/src/Api/ApigeeX/Denormalizer/PrepaidBalanceDenormalizer.php
index 51f6d1f7c..6e30adbcd 100755
--- a/src/Api/ApigeeX/Denormalizer/PrepaidBalanceDenormalizer.php
+++ b/src/Api/ApigeeX/Denormalizer/PrepaidBalanceDenormalizer.php
@@ -26,7 +26,7 @@
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class PrepaidBalanceDenormalizer extends ObjectDenormalizer
+final class PrepaidBalanceDenormalizer extends ObjectDenormalizer
{
/**
* PrepaidBalanceDenormalizer constructor.
@@ -52,6 +52,6 @@ public function supportsDenormalization($data, $type, $format = null, array $con
return false;
}
- return PrepaidBalanceInterface::class === $type || $type instanceof PrepaidBalanceInterface || in_array(PrepaidBalanceInterface::class, class_implements($type));
+ return PrepaidBalanceInterface::class === $type || $type instanceof PrepaidBalanceInterface || in_array(PrepaidBalanceInterface::class, class_implements($type) ?: []);
}
}
diff --git a/src/Api/ApigeeX/Denormalizer/RatePlanDenormalizer.php b/src/Api/ApigeeX/Denormalizer/RatePlanDenormalizer.php
index c28410602..f9f6c7739 100755
--- a/src/Api/ApigeeX/Denormalizer/RatePlanDenormalizer.php
+++ b/src/Api/ApigeeX/Denormalizer/RatePlanDenormalizer.php
@@ -72,6 +72,6 @@ public function supportsDenormalization($data, $type, $format = null, array $con
return false;
}
- return RatePlanInterface::class === $type || $type instanceof RatePlanInterface || in_array(RatePlanInterface::class, class_implements($type));
+ return RatePlanInterface::class === $type || $type instanceof RatePlanInterface || in_array(RatePlanInterface::class, class_implements($type) ?: []);
}
}
diff --git a/src/Api/ApigeeX/Denormalizer/RatePlanDenormalizerFactory.php b/src/Api/ApigeeX/Denormalizer/RatePlanDenormalizerFactory.php
index ca802adba..be7581ac7 100755
--- a/src/Api/ApigeeX/Denormalizer/RatePlanDenormalizerFactory.php
+++ b/src/Api/ApigeeX/Denormalizer/RatePlanDenormalizerFactory.php
@@ -26,7 +26,7 @@
use Symfony\Component\Serializer\SerializerAwareTrait;
use Symfony\Component\Serializer\SerializerInterface;
-class RatePlanDenormalizerFactory implements DenormalizerInterface, SerializerAwareInterface
+final class RatePlanDenormalizerFactory implements DenormalizerInterface, SerializerAwareInterface
{
use SerializerAwareTrait {
setSerializer as private traitSetSerializer;
diff --git a/src/Api/ApigeeX/Denormalizer/RatePlanRateDenormalizer.php b/src/Api/ApigeeX/Denormalizer/RatePlanRateDenormalizer.php
index 9c7fc655b..62e2cf659 100755
--- a/src/Api/ApigeeX/Denormalizer/RatePlanRateDenormalizer.php
+++ b/src/Api/ApigeeX/Denormalizer/RatePlanRateDenormalizer.php
@@ -24,7 +24,7 @@
use Apigee\Edge\Denormalizer\ObjectDenormalizer;
use Symfony\Component\Serializer\Exception\UnexpectedValueException;
-class RatePlanRateDenormalizer extends ObjectDenormalizer
+final class RatePlanRateDenormalizer extends ObjectDenormalizer
{
protected $revShareClass = RatePlanRateRevShare::class;
diff --git a/src/Api/ApigeeX/Denormalizer/StandardRatePlanDenormalizer.php b/src/Api/ApigeeX/Denormalizer/StandardRatePlanDenormalizer.php
index b5dd1475f..8f44f60e9 100755
--- a/src/Api/ApigeeX/Denormalizer/StandardRatePlanDenormalizer.php
+++ b/src/Api/ApigeeX/Denormalizer/StandardRatePlanDenormalizer.php
@@ -22,7 +22,7 @@
use Apigee\Edge\Api\ApigeeX\Entity\StandardRatePlan;
use Apigee\Edge\Api\ApigeeX\Entity\StandardRatePlanRevision;
-class StandardRatePlanDenormalizer extends RatePlanDenormalizer
+final class StandardRatePlanDenormalizer extends RatePlanDenormalizer
{
/**
* Fully qualified class name of the standard rate plan entity.
diff --git a/src/Api/ApigeeX/Entity/ApiProduct.php b/src/Api/ApigeeX/Entity/ApiProduct.php
index d2cdedee2..a3e6e00ae 100755
--- a/src/Api/ApigeeX/Entity/ApiProduct.php
+++ b/src/Api/ApigeeX/Entity/ApiProduct.php
@@ -24,7 +24,7 @@
use Apigee\Edge\Entity\Property\DisplayNamePropertyAwareTrait;
use Apigee\Edge\Entity\Property\NamePropertyAwareTrait;
-class ApiProduct extends Entity implements ApiProductInterface
+final class ApiProduct extends Entity implements ApiProductInterface
{
use AttributesPropertyAwareTrait;
use DescriptionPropertyAwareTrait;
diff --git a/src/Api/ApigeeX/Entity/AppGroup.php b/src/Api/ApigeeX/Entity/AppGroup.php
index 0c8dead02..133dfbeab 100644
--- a/src/Api/ApigeeX/Entity/AppGroup.php
+++ b/src/Api/ApigeeX/Entity/AppGroup.php
@@ -29,7 +29,7 @@
/**
* Describes an AppGroup entity.
*/
-class AppGroup extends Entity implements AppGroupInterface
+final class AppGroup extends Entity implements AppGroupInterface
{
use DisplayNamePropertyAwareTrait;
use NamePropertyAwareTrait;
diff --git a/src/Api/ApigeeX/Entity/AppGroupApp.php b/src/Api/ApigeeX/Entity/AppGroupApp.php
index 63e4bdf38..341b8645c 100644
--- a/src/Api/ApigeeX/Entity/AppGroupApp.php
+++ b/src/Api/ApigeeX/Entity/AppGroupApp.php
@@ -23,7 +23,7 @@
/**
* Class AppGroupApp.
*/
-class AppGroupApp extends App implements AppGroupAppInterface
+final class AppGroupApp extends App implements AppGroupAppInterface
{
/** @var string */
protected $appGroup;
diff --git a/src/Api/ApigeeX/Entity/Balance.php b/src/Api/ApigeeX/Entity/Balance.php
index bd3f26699..f080493ce 100755
--- a/src/Api/ApigeeX/Entity/Balance.php
+++ b/src/Api/ApigeeX/Entity/Balance.php
@@ -23,7 +23,7 @@
use Apigee\Edge\Api\ApigeeX\Entity\Property\UnitsPropertyAwareTrait;
use Apigee\Edge\Api\Monetization\Entity\Entity;
-class Balance extends Entity
+final class Balance extends Entity
{
use CurrencyCodePropertyAwareTrait;
use NanosPropertyAwareTrait;
diff --git a/src/Api/ApigeeX/Entity/DeveloperAcceptedRatePlan.php b/src/Api/ApigeeX/Entity/DeveloperAcceptedRatePlan.php
index 5214f0af2..b772d271c 100755
--- a/src/Api/ApigeeX/Entity/DeveloperAcceptedRatePlan.php
+++ b/src/Api/ApigeeX/Entity/DeveloperAcceptedRatePlan.php
@@ -23,7 +23,7 @@
/**
* Represents an accepted rate plan by a developer.
*/
-class DeveloperAcceptedRatePlan extends AcceptedRatePlan implements DeveloperAcceptedRatePlanInterface
+final class DeveloperAcceptedRatePlan extends AcceptedRatePlan implements DeveloperAcceptedRatePlanInterface
{
use DeveloperPropertyAwareTrait;
}
diff --git a/src/Api/ApigeeX/Entity/DeveloperBillingType.php b/src/Api/ApigeeX/Entity/DeveloperBillingType.php
index 477346305..de086c781 100644
--- a/src/Api/ApigeeX/Entity/DeveloperBillingType.php
+++ b/src/Api/ApigeeX/Entity/DeveloperBillingType.php
@@ -21,6 +21,6 @@
/**
* Represents billing type of a developer.
*/
-class DeveloperBillingType extends BillingType implements DeveloperBillingTypeInterface
+final class DeveloperBillingType extends BillingType implements DeveloperBillingTypeInterface
{
}
diff --git a/src/Api/ApigeeX/Entity/PrepaidBalance.php b/src/Api/ApigeeX/Entity/PrepaidBalance.php
index 473e948e8..be607fbe4 100755
--- a/src/Api/ApigeeX/Entity/PrepaidBalance.php
+++ b/src/Api/ApigeeX/Entity/PrepaidBalance.php
@@ -20,7 +20,7 @@
use Apigee\Edge\Api\Monetization\Entity\Entity;
-class PrepaidBalance extends Entity implements PrepaidBalanceInterface
+final class PrepaidBalance extends Entity implements PrepaidBalanceInterface
{
/** @var string|null */
protected $lastCreditTime;
diff --git a/src/Api/ApigeeX/Entity/Property/NanosPropertyAwareTrait.php b/src/Api/ApigeeX/Entity/Property/NanosPropertyAwareTrait.php
index 47bc2e201..f049eaab6 100755
--- a/src/Api/ApigeeX/Entity/Property/NanosPropertyAwareTrait.php
+++ b/src/Api/ApigeeX/Entity/Property/NanosPropertyAwareTrait.php
@@ -33,9 +33,9 @@ trait NanosPropertyAwareTrait
*/
public function getNanos(): ?float
{
- $nanos = $this->nanos ?? 0;
+ $nanos = $this->nanos ?? 0.0;
- return $nanos * pow(10, -9);
+ return $nanos * 1e-9;
}
/**
diff --git a/src/Api/ApigeeX/Entity/StandardRatePlanRevision.php b/src/Api/ApigeeX/Entity/StandardRatePlanRevision.php
index 069ee7f8a..94936dac6 100755
--- a/src/Api/ApigeeX/Entity/StandardRatePlanRevision.php
+++ b/src/Api/ApigeeX/Entity/StandardRatePlanRevision.php
@@ -21,7 +21,7 @@
use Apigee\Edge\Api\Monetization\Entity\Property\KeepOriginalStartDatePropertyAwareTrait;
use Apigee\Edge\Api\Monetization\Entity\Property\PreviousRatePlanRevisionPropertyAwareTrait;
-class StandardRatePlanRevision extends StandardRatePlan implements RatePlanRevisionInterface
+final class StandardRatePlanRevision extends StandardRatePlan implements RatePlanRevisionInterface
{
use KeepOriginalStartDatePropertyAwareTrait;
use PreviousRatePlanRevisionPropertyAwareTrait;
diff --git a/src/Api/ApigeeX/NameConverter/RatePlanNameConverter.php b/src/Api/ApigeeX/NameConverter/RatePlanNameConverter.php
index 14fc3c723..90da3106a 100755
--- a/src/Api/ApigeeX/NameConverter/RatePlanNameConverter.php
+++ b/src/Api/ApigeeX/NameConverter/RatePlanNameConverter.php
@@ -25,6 +25,8 @@
* Maps rate plan properties from the API response to their destination properties.
*
* @see \Apigee\Edge\Api\ApigeeX\Entity\RatePlan
+ *
+ * @psalm-suppress ClassMustBeFinal
*/
class RatePlanNameConverter extends NameConverterBase implements NameConverterInterface
{
diff --git a/src/Api/ApigeeX/Normalizer/AcceptedRatePlanNormalizer.php b/src/Api/ApigeeX/Normalizer/AcceptedRatePlanNormalizer.php
index 18cb79f17..6dc5be0dd 100755
--- a/src/Api/ApigeeX/Normalizer/AcceptedRatePlanNormalizer.php
+++ b/src/Api/ApigeeX/Normalizer/AcceptedRatePlanNormalizer.php
@@ -21,7 +21,11 @@
use Apigee\Edge\Api\ApigeeX\Entity\AcceptedRatePlanInterface;
use Apigee\Edge\Api\Monetization\Normalizer\EntityNormalizer;
use Apigee\Edge\Api\Monetization\Utility\TimezoneFixerHelperTrait;
+use ArrayObject;
+/**
+ * @psalm-suppress ClassMustBeFinal
+ */
class AcceptedRatePlanNormalizer extends EntityNormalizer
{
use TimezoneFixerHelperTrait;
@@ -32,7 +36,7 @@ class AcceptedRatePlanNormalizer extends EntityNormalizer
* @psalm-suppress InvalidReturnType Returning an object here is required
* for creating a valid Apigee Edge request.
*/
- public function normalize($data, $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 $data */
/** @var object $normalized */
diff --git a/src/Api/ApigeeX/Normalizer/ApiProductNormalizer.php b/src/Api/ApigeeX/Normalizer/ApiProductNormalizer.php
index ceb5f712d..d1762a14e 100755
--- a/src/Api/ApigeeX/Normalizer/ApiProductNormalizer.php
+++ b/src/Api/ApigeeX/Normalizer/ApiProductNormalizer.php
@@ -21,12 +21,13 @@
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;
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class ApiProductNormalizer extends EntityNormalizer
+final class ApiProductNormalizer extends EntityNormalizer
{
/**
* ApiProductNormalizer constructor.
@@ -48,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($data, $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($data, $format, $context);
diff --git a/src/Api/ApigeeX/Normalizer/AppGroupMembershipNormalizer.php b/src/Api/ApigeeX/Normalizer/AppGroupMembershipNormalizer.php
index 73f6644c0..0b422a828 100644
--- a/src/Api/ApigeeX/Normalizer/AppGroupMembershipNormalizer.php
+++ b/src/Api/ApigeeX/Normalizer/AppGroupMembershipNormalizer.php
@@ -19,9 +19,10 @@
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
+final class AppGroupMembershipNormalizer implements NormalizerInterface
{
/**
* {@inheritdoc}
@@ -29,7 +30,7 @@ class AppGroupMembershipNormalizer implements NormalizerInterface
* @psalm-suppress InvalidReturnType Returning an object here is required
* for creating a valid Apigee Edge request.
*/
- public function normalize($data, $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 = [];
diff --git a/src/Api/ApigeeX/Normalizer/AppNormalizer.php b/src/Api/ApigeeX/Normalizer/AppNormalizer.php
index c55a39dc0..55e7a1576 100644
--- a/src/Api/ApigeeX/Normalizer/AppNormalizer.php
+++ b/src/Api/ApigeeX/Normalizer/AppNormalizer.php
@@ -20,12 +20,13 @@
use Apigee\Edge\Api\Management\Entity\AppInterface;
use Apigee\Edge\Normalizer\ObjectNormalizer;
+use ArrayObject;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
/**
* Class AppNormalizer.
*/
-class AppNormalizer extends ObjectNormalizer implements NormalizerInterface
+final class AppNormalizer extends ObjectNormalizer implements NormalizerInterface
{
/**
* {@inheritdoc}
@@ -41,7 +42,7 @@ 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($data, $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($data, $format, $context);
diff --git a/src/Api/ApigeeX/Normalizer/BillingTypeNormalizer.php b/src/Api/ApigeeX/Normalizer/BillingTypeNormalizer.php
index 6d3912899..0dbfaa412 100644
--- a/src/Api/ApigeeX/Normalizer/BillingTypeNormalizer.php
+++ b/src/Api/ApigeeX/Normalizer/BillingTypeNormalizer.php
@@ -20,8 +20,9 @@
use Apigee\Edge\Api\ApigeeX\Entity\BillingTypeInterface;
use Apigee\Edge\Api\Monetization\Normalizer\EntityNormalizer;
+use ArrayObject;
-class BillingTypeNormalizer extends EntityNormalizer
+final class BillingTypeNormalizer extends EntityNormalizer
{
/**
* {@inheritdoc}
@@ -29,7 +30,7 @@ class BillingTypeNormalizer extends EntityNormalizer
* @psalm-suppress InvalidReturnType Returning an object here is required
* for creating a valid Apigee Edge request.
*/
- public function normalize($data, $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 $data */
/** @var object $normalized */
diff --git a/src/Api/ApigeeX/Normalizer/PrepaidBalanceNormalizer.php b/src/Api/ApigeeX/Normalizer/PrepaidBalanceNormalizer.php
index 090bae1ba..82a962b4d 100755
--- a/src/Api/ApigeeX/Normalizer/PrepaidBalanceNormalizer.php
+++ b/src/Api/ApigeeX/Normalizer/PrepaidBalanceNormalizer.php
@@ -26,7 +26,7 @@
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class PrepaidBalanceNormalizer extends EntityNormalizer
+final class PrepaidBalanceNormalizer extends EntityNormalizer
{
/**
* PrepaidBalanceNormalizer constructor.
diff --git a/src/Api/ApigeeX/Normalizer/RatePlanNormalizer.php b/src/Api/ApigeeX/Normalizer/RatePlanNormalizer.php
index 987cbdf79..ac1d79e79 100755
--- a/src/Api/ApigeeX/Normalizer/RatePlanNormalizer.php
+++ b/src/Api/ApigeeX/Normalizer/RatePlanNormalizer.php
@@ -23,6 +23,7 @@
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;
@@ -52,7 +53,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($data, $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($data, $format, $context);
diff --git a/src/Api/ApigeeX/Normalizer/RatePlanNormalizerFactory.php b/src/Api/ApigeeX/Normalizer/RatePlanNormalizerFactory.php
index 20f3d45c8..a27d7658f 100755
--- a/src/Api/ApigeeX/Normalizer/RatePlanNormalizerFactory.php
+++ b/src/Api/ApigeeX/Normalizer/RatePlanNormalizerFactory.php
@@ -21,12 +21,13 @@
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;
use Symfony\Component\Serializer\SerializerInterface;
-class RatePlanNormalizerFactory implements NormalizerInterface, SerializerAwareInterface
+final class RatePlanNormalizerFactory implements NormalizerInterface, SerializerAwareInterface
{
use SerializerAwareTrait {
setSerializer as private traitSetSerializer;
@@ -56,7 +57,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($data, $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
diff --git a/src/Api/ApigeeX/Normalizer/RatePlanRateNormalizer.php b/src/Api/ApigeeX/Normalizer/RatePlanRateNormalizer.php
index 088cbc4c5..a579c881e 100755
--- a/src/Api/ApigeeX/Normalizer/RatePlanRateNormalizer.php
+++ b/src/Api/ApigeeX/Normalizer/RatePlanRateNormalizer.php
@@ -21,8 +21,9 @@
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
+final class RatePlanRateNormalizer extends ObjectNormalizer
{
/**
* {@inheritdoc}
@@ -30,7 +31,7 @@ class RatePlanRateNormalizer extends ObjectNormalizer
* @psalm-suppress InvalidReturnType Returning an object here is required
* for creating a valid Apigee Edge request.
*/
- public function normalize($data, $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($data, $format, $context);
diff --git a/src/Api/ApigeeX/Normalizer/StandardRatePlanNormalizer.php b/src/Api/ApigeeX/Normalizer/StandardRatePlanNormalizer.php
index 6b72264ba..d00377be8 100755
--- a/src/Api/ApigeeX/Normalizer/StandardRatePlanNormalizer.php
+++ b/src/Api/ApigeeX/Normalizer/StandardRatePlanNormalizer.php
@@ -20,8 +20,9 @@
use Apigee\Edge\Api\ApigeeX\Entity\RatePlanInterface;
use Apigee\Edge\Api\ApigeeX\Entity\StandardRatePlanInterface;
+use ArrayObject;
-class StandardRatePlanNormalizer extends RatePlanNormalizer
+final class StandardRatePlanNormalizer extends RatePlanNormalizer
{
/**
* {@inheritdoc}
@@ -29,7 +30,7 @@ class StandardRatePlanNormalizer extends RatePlanNormalizer
* @psalm-suppress InvalidReturnType Returning an object here is required
* for creating a valid Apigee Edge request.
*/
- public function normalize($data, $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($data, $format, $context);
diff --git a/src/Api/ApigeeX/Serializer/AcceptedRatePlanSerializer.php b/src/Api/ApigeeX/Serializer/AcceptedRatePlanSerializer.php
index 82dedb964..d61528dad 100755
--- a/src/Api/ApigeeX/Serializer/AcceptedRatePlanSerializer.php
+++ b/src/Api/ApigeeX/Serializer/AcceptedRatePlanSerializer.php
@@ -26,7 +26,7 @@
use Apigee\Edge\Api\Monetization\Serializer\LegalEntitySerializer;
use Apigee\Edge\Api\Monetization\Serializer\RatePlanSerializer;
-class AcceptedRatePlanSerializer extends EntitySerializer
+final class AcceptedRatePlanSerializer extends EntitySerializer
{
/**
* {@inheritdoc}
diff --git a/src/Api/ApigeeX/Serializer/ApiProductSerializer.php b/src/Api/ApigeeX/Serializer/ApiProductSerializer.php
index ad9bb169f..ad25dda85 100755
--- a/src/Api/ApigeeX/Serializer/ApiProductSerializer.php
+++ b/src/Api/ApigeeX/Serializer/ApiProductSerializer.php
@@ -22,7 +22,7 @@
use Apigee\Edge\Api\ApigeeX\Normalizer\ApiProductNormalizer;
use Apigee\Edge\Api\Monetization\Serializer\EntitySerializer;
-class ApiProductSerializer extends EntitySerializer
+final class ApiProductSerializer extends EntitySerializer
{
/**
* {@inheritdoc}
diff --git a/src/Api/ApigeeX/Serializer/AppGroupEntitySerializer.php b/src/Api/ApigeeX/Serializer/AppGroupEntitySerializer.php
index d04a8d0be..18e321b54 100644
--- a/src/Api/ApigeeX/Serializer/AppGroupEntitySerializer.php
+++ b/src/Api/ApigeeX/Serializer/AppGroupEntitySerializer.php
@@ -26,7 +26,7 @@
use Apigee\Edge\Normalizer\CredentialProductNormalizer;
use Apigee\Edge\Serializer\EntitySerializer;
-class AppGroupEntitySerializer extends EntitySerializer
+final class AppGroupEntitySerializer extends EntitySerializer
{
/**
* AppGroupEntitySerializer constructor.
diff --git a/src/Api/ApigeeX/Serializer/AppGroupMembershipSerializer.php b/src/Api/ApigeeX/Serializer/AppGroupMembershipSerializer.php
index b912560e1..fae2bfa74 100644
--- a/src/Api/ApigeeX/Serializer/AppGroupMembershipSerializer.php
+++ b/src/Api/ApigeeX/Serializer/AppGroupMembershipSerializer.php
@@ -22,7 +22,7 @@
use Apigee\Edge\Api\ApigeeX\Normalizer\AppGroupMembershipNormalizer;
use Apigee\Edge\Serializer\EntitySerializer;
-class AppGroupMembershipSerializer extends EntitySerializer
+final class AppGroupMembershipSerializer extends EntitySerializer
{
/**
* AppGroupMembershipSerializer constructor.
diff --git a/src/Api/ApigeeX/Serializer/AppGroupSerializer.php b/src/Api/ApigeeX/Serializer/AppGroupSerializer.php
index a4ecd5e8a..c93ec0b60 100644
--- a/src/Api/ApigeeX/Serializer/AppGroupSerializer.php
+++ b/src/Api/ApigeeX/Serializer/AppGroupSerializer.php
@@ -20,6 +20,6 @@
use Apigee\Edge\Api\Management\Serializer\AttributesPropertyAwareEntitySerializer;
-class AppGroupSerializer extends AttributesPropertyAwareEntitySerializer
+final class AppGroupSerializer extends AttributesPropertyAwareEntitySerializer
{
}
diff --git a/src/Api/ApigeeX/Serializer/BillingTypeSerializer.php b/src/Api/ApigeeX/Serializer/BillingTypeSerializer.php
index 2d095a3ba..a07c92fcd 100644
--- a/src/Api/ApigeeX/Serializer/BillingTypeSerializer.php
+++ b/src/Api/ApigeeX/Serializer/BillingTypeSerializer.php
@@ -22,7 +22,7 @@
use Apigee\Edge\Api\ApigeeX\Normalizer\BillingTypeNormalizer;
use Apigee\Edge\Api\Monetization\Serializer\EntitySerializer;
-class BillingTypeSerializer extends EntitySerializer
+final class BillingTypeSerializer extends EntitySerializer
{
/**
* {@inheritdoc}
diff --git a/src/Api/ApigeeX/Serializer/PrepaidBalanceSerializer.php b/src/Api/ApigeeX/Serializer/PrepaidBalanceSerializer.php
index b8d793938..08c864ea5 100755
--- a/src/Api/ApigeeX/Serializer/PrepaidBalanceSerializer.php
+++ b/src/Api/ApigeeX/Serializer/PrepaidBalanceSerializer.php
@@ -23,7 +23,7 @@
use Apigee\Edge\Api\Monetization\Serializer\EntitySerializer;
use Apigee\Edge\Api\Monetization\Serializer\SupportedCurrencySerializer;
-class PrepaidBalanceSerializer extends EntitySerializer
+final class PrepaidBalanceSerializer extends EntitySerializer
{
/**
* {@inheritDoc}
diff --git a/src/Api/ApigeeX/Serializer/RatePlanSerializer.php b/src/Api/ApigeeX/Serializer/RatePlanSerializer.php
index b0061e62e..260615024 100755
--- a/src/Api/ApigeeX/Serializer/RatePlanSerializer.php
+++ b/src/Api/ApigeeX/Serializer/RatePlanSerializer.php
@@ -25,7 +25,7 @@
use Apigee\Edge\Api\Monetization\Serializer\EntitySerializer;
use Apigee\Edge\Api\Monetization\Serializer\LegalEntitySerializer;
-class RatePlanSerializer extends EntitySerializer
+final class RatePlanSerializer extends EntitySerializer
{
/**
* {@inheritdoc}
diff --git a/src/Api/Management/Controller/ApiProductController.php b/src/Api/Management/Controller/ApiProductController.php
index 24536ab11..b74658cf6 100644
--- a/src/Api/Management/Controller/ApiProductController.php
+++ b/src/Api/Management/Controller/ApiProductController.php
@@ -33,7 +33,7 @@
/**
* Class ApiProductController.
*/
-class ApiProductController extends PaginatedEntityController implements ApiProductControllerInterface
+final class ApiProductController extends PaginatedEntityController implements ApiProductControllerInterface
{
use AttributesAwareEntityControllerTrait;
use EntityCrudOperationsControllerTrait;
diff --git a/src/Api/Management/Controller/AppController.php b/src/Api/Management/Controller/AppController.php
index f6886b2cd..4a1ae5f46 100644
--- a/src/Api/Management/Controller/AppController.php
+++ b/src/Api/Management/Controller/AppController.php
@@ -31,7 +31,7 @@
/**
* Class AppController.
*/
-class AppController extends PaginatedEntityController implements AppControllerInterface
+final class AppController extends PaginatedEntityController implements AppControllerInterface
{
use EntityListingControllerTrait;
use PaginationHelperTrait {
diff --git a/src/Api/Management/Controller/AttributesAwareEntityControllerTrait.php b/src/Api/Management/Controller/AttributesAwareEntityControllerTrait.php
index 5f5f3f820..94de485fb 100644
--- a/src/Api/Management/Controller/AttributesAwareEntityControllerTrait.php
+++ b/src/Api/Management/Controller/AttributesAwareEntityControllerTrait.php
@@ -114,7 +114,7 @@ public function deleteAttribute(string $entityId, string $name): void
protected function getEntityAttributesUri(string $entityId): UriInterface
{
$uri = $this->getEntityEndpointUri($entityId)->withPath(
- $this->getEntityEndpointUri($entityId) . '/attributes'
+ (string) $this->getEntityEndpointUri($entityId) . '/attributes'
);
return $uri;
@@ -132,7 +132,7 @@ protected function getEntityAttributeUri(string $entityId, string $name): UriInt
{
$encoded = rawurlencode($name);
$uri = $this->getEntityAttributesUri($entityId)->withPath(
- $this->getEntityAttributesUri($entityId) . '/' . $encoded
+ (string) $this->getEntityAttributesUri($entityId) . '/' . $encoded
);
return $uri;
diff --git a/src/Api/Management/Controller/CompanyAppController.php b/src/Api/Management/Controller/CompanyAppController.php
index 6e30fdee6..64a22757c 100644
--- a/src/Api/Management/Controller/CompanyAppController.php
+++ b/src/Api/Management/Controller/CompanyAppController.php
@@ -27,7 +27,7 @@
/**
* Class CompanyAppController.
*/
-class CompanyAppController extends AppByOwnerController implements CompanyAppControllerInterface
+final class CompanyAppController extends AppByOwnerController implements CompanyAppControllerInterface
{
use CompanyAwareControllerTrait;
/**
diff --git a/src/Api/Management/Controller/CompanyController.php b/src/Api/Management/Controller/CompanyController.php
index 3379fba85..38edd76e5 100644
--- a/src/Api/Management/Controller/CompanyController.php
+++ b/src/Api/Management/Controller/CompanyController.php
@@ -34,7 +34,7 @@
/**
* Class CompanyController.
*/
-class CompanyController extends PaginatedEntityController implements CompanyControllerInterface
+final class CompanyController extends PaginatedEntityController implements CompanyControllerInterface
{
use AttributesAwareEntityControllerTrait;
use EntityCrudOperationsControllerTrait;
diff --git a/src/Api/Management/Controller/CompanyMembersController.php b/src/Api/Management/Controller/CompanyMembersController.php
index d190f00a5..640bd8fdd 100644
--- a/src/Api/Management/Controller/CompanyMembersController.php
+++ b/src/Api/Management/Controller/CompanyMembersController.php
@@ -28,7 +28,7 @@
/**
* Allows to manage company memberships.
*/
-class CompanyMembersController extends AbstractController implements CompanyMembersControllerInterface
+final class CompanyMembersController extends AbstractController implements CompanyMembersControllerInterface
{
use CompanyAwareControllerTrait;
use OrganizationAwareControllerTrait;
diff --git a/src/Api/Management/Controller/DeveloperAppController.php b/src/Api/Management/Controller/DeveloperAppController.php
index 9e8b66685..cf14e302b 100644
--- a/src/Api/Management/Controller/DeveloperAppController.php
+++ b/src/Api/Management/Controller/DeveloperAppController.php
@@ -25,7 +25,7 @@
/**
* Class DeveloperAppController.
*/
-class DeveloperAppController extends AppByOwnerController implements DeveloperAppControllerInterface
+final class DeveloperAppController extends AppByOwnerController implements DeveloperAppControllerInterface
{
/**
* @var string Developer email or id.
diff --git a/src/Api/Management/Controller/DeveloperAppCredentialController.php b/src/Api/Management/Controller/DeveloperAppCredentialController.php
index 57d59dfd0..abce0a79d 100644
--- a/src/Api/Management/Controller/DeveloperAppCredentialController.php
+++ b/src/Api/Management/Controller/DeveloperAppCredentialController.php
@@ -25,7 +25,7 @@
/**
* Class DeveloperAppCredentialController.
*/
-class DeveloperAppCredentialController extends AppCredentialController implements DeveloperAppCredentialControllerInterface
+final class DeveloperAppCredentialController extends AppCredentialController implements DeveloperAppCredentialControllerInterface
{
/** @var string Developer email or id. */
protected $developerId;
diff --git a/src/Api/Management/Controller/DeveloperController.php b/src/Api/Management/Controller/DeveloperController.php
index 7c95340dc..108acdda4 100644
--- a/src/Api/Management/Controller/DeveloperController.php
+++ b/src/Api/Management/Controller/DeveloperController.php
@@ -38,7 +38,7 @@
/**
* Class DeveloperController.
*/
-class DeveloperController extends PaginatedEntityController implements DeveloperControllerInterface
+final class DeveloperController extends PaginatedEntityController implements DeveloperControllerInterface
{
use AttributesAwareEntityControllerTrait;
use EntityCrudOperationsControllerTrait;
diff --git a/src/Api/Management/Controller/EnvironmentController.php b/src/Api/Management/Controller/EnvironmentController.php
index 24fe7c939..c95ff7f29 100644
--- a/src/Api/Management/Controller/EnvironmentController.php
+++ b/src/Api/Management/Controller/EnvironmentController.php
@@ -30,7 +30,7 @@
/**
* Class EnvironmentController.
*/
-class EnvironmentController extends EntityController implements EnvironmentControllerInterface
+final class EnvironmentController extends EntityController implements EnvironmentControllerInterface
{
use EntityCrudOperationsControllerTrait;
use NonPaginatedEntityIdListingControllerTrait;
diff --git a/src/Api/Management/Controller/OrganizationController.php b/src/Api/Management/Controller/OrganizationController.php
index 8d05f5cf7..cfb540901 100644
--- a/src/Api/Management/Controller/OrganizationController.php
+++ b/src/Api/Management/Controller/OrganizationController.php
@@ -32,7 +32,7 @@
/**
* Class OrganizationController.
*/
-class OrganizationController extends AbstractEntityController implements OrganizationControllerInterface
+final class OrganizationController extends AbstractEntityController implements OrganizationControllerInterface
{
use EntityCrudOperationsControllerTrait;
use EntityListingControllerTrait;
diff --git a/src/Api/Management/Controller/StatsController.php b/src/Api/Management/Controller/StatsController.php
index 05ca7c0f8..6b5127d98 100644
--- a/src/Api/Management/Controller/StatsController.php
+++ b/src/Api/Management/Controller/StatsController.php
@@ -33,7 +33,7 @@
/**
* Class StatsController.
*/
-class StatsController extends AbstractController implements StatsControllerInterface
+final class StatsController extends AbstractController implements StatsControllerInterface
{
use OrganizationAwareControllerTrait;
@@ -234,10 +234,10 @@ protected function getBaseEndpointUri(): UriInterface
{
if ($this->isHybrid()) {
return $this->client->getUriFactory()->createUri("/organizations/{$this->organization}/environments/$this->environment/optimizedStats/");
- } else {
- // Slash in the end is always required.
- return $this->client->getUriFactory()->createUri("/organizations/{$this->organization}/environments/$this->environment/stats/");
}
+
+ // Slash in the end is always required.
+ return $this->client->getUriFactory()->createUri("/organizations/{$this->organization}/environments/$this->environment/stats/");
}
/**
diff --git a/src/Api/Management/Denormalizer/AppDenormalizer.php b/src/Api/Management/Denormalizer/AppDenormalizer.php
index c57c77f0e..e76b08bae 100644
--- a/src/Api/Management/Denormalizer/AppDenormalizer.php
+++ b/src/Api/Management/Denormalizer/AppDenormalizer.php
@@ -27,7 +27,7 @@
/**
* Dynamically denormalizes apps to developer- or company apps.
*/
-class AppDenormalizer extends ObjectDenormalizer
+final class AppDenormalizer extends ObjectDenormalizer
{
/**
* Fully qualified class name of the developer app entity.
@@ -68,6 +68,6 @@ public function supportsDenormalization($data, $type, $format = null, array $con
return false;
}
- return AppInterface::class === $type || $type instanceof AppInterface || in_array(AppInterface::class, class_implements($type));
+ return AppInterface::class === $type || $type instanceof AppInterface || in_array(AppInterface::class, class_implements($type) ?: []);
}
}
diff --git a/src/Api/Management/Denormalizer/CompanyMembershipDenormalizer.php b/src/Api/Management/Denormalizer/CompanyMembershipDenormalizer.php
index 337d3d72a..76349b1af 100755
--- a/src/Api/Management/Denormalizer/CompanyMembershipDenormalizer.php
+++ b/src/Api/Management/Denormalizer/CompanyMembershipDenormalizer.php
@@ -24,7 +24,7 @@
/**
* Denormalizes company membership data.
*/
-class CompanyMembershipDenormalizer implements DenormalizerInterface
+final class CompanyMembershipDenormalizer implements DenormalizerInterface
{
/**
* {@inheritdoc}
diff --git a/src/Api/Management/Entity/ApiProduct.php b/src/Api/Management/Entity/ApiProduct.php
index 17c89fb08..a4ac34721 100644
--- a/src/Api/Management/Entity/ApiProduct.php
+++ b/src/Api/Management/Entity/ApiProduct.php
@@ -32,7 +32,7 @@
/**
* Describes an API product entity.
*/
-class ApiProduct extends Entity implements ApiProductInterface
+final class ApiProduct extends Entity implements ApiProductInterface
{
use AttributesPropertyAwareTrait;
use CommonEntityPropertiesAwareTrait;
diff --git a/src/Api/Management/Entity/AppCredential.php b/src/Api/Management/Entity/AppCredential.php
index 1463691ef..a2a688a71 100644
--- a/src/Api/Management/Entity/AppCredential.php
+++ b/src/Api/Management/Entity/AppCredential.php
@@ -30,7 +30,7 @@
/**
* Class AppCredential.
*/
-class AppCredential extends Entity implements AppCredentialInterface
+final class AppCredential extends Entity implements AppCredentialInterface
{
use AttributesPropertyAwareTrait;
use ScopesPropertyAwareTrait;
diff --git a/src/Api/Management/Entity/Company.php b/src/Api/Management/Entity/Company.php
index 60c998a70..3cb85b3ee 100644
--- a/src/Api/Management/Entity/Company.php
+++ b/src/Api/Management/Entity/Company.php
@@ -25,7 +25,7 @@
/**
* Describes a Company entity.
*/
-class Company extends AppOwner implements CompanyInterface
+final class Company extends AppOwner implements CompanyInterface
{
use DisplayNamePropertyAwareTrait;
use NamePropertyAwareTrait;
diff --git a/src/Api/Management/Entity/CompanyApp.php b/src/Api/Management/Entity/CompanyApp.php
index d6fda057b..631bdfec1 100644
--- a/src/Api/Management/Entity/CompanyApp.php
+++ b/src/Api/Management/Entity/CompanyApp.php
@@ -21,7 +21,7 @@
/**
* Class CompanyApp.
*/
-class CompanyApp extends App implements CompanyAppInterface
+final class CompanyApp extends App implements CompanyAppInterface
{
/** @var string */
protected $companyName;
diff --git a/src/Api/Management/Entity/Developer.php b/src/Api/Management/Entity/Developer.php
index 13a20817f..715c75422 100644
--- a/src/Api/Management/Entity/Developer.php
+++ b/src/Api/Management/Entity/Developer.php
@@ -26,7 +26,7 @@
/**
* Describes a Developer entity.
*/
-class Developer extends AppOwner implements DeveloperInterface
+final class Developer extends AppOwner implements DeveloperInterface
{
use DeveloperIdPropertyAwareTrait;
use EmailPropertyAwareTrait;
diff --git a/src/Api/Management/Entity/DeveloperApp.php b/src/Api/Management/Entity/DeveloperApp.php
index 5604b5472..d13b47cb9 100644
--- a/src/Api/Management/Entity/DeveloperApp.php
+++ b/src/Api/Management/Entity/DeveloperApp.php
@@ -23,7 +23,7 @@
/**
* Class DeveloperApp.
*/
-class DeveloperApp extends App implements DeveloperAppInterface
+final class DeveloperApp extends App implements DeveloperAppInterface
{
use DeveloperIdPropertyAwareTrait;
}
diff --git a/src/Api/Management/Entity/Environment.php b/src/Api/Management/Entity/Environment.php
index 04dd139a6..a31da740a 100644
--- a/src/Api/Management/Entity/Environment.php
+++ b/src/Api/Management/Entity/Environment.php
@@ -31,7 +31,7 @@
* @TODO
* "mdc" property is ignored.
*/
-class Environment extends Entity implements EnvironmentInterface
+final class Environment extends Entity implements EnvironmentInterface
{
use CommonEntityPropertiesAwareTrait;
use NamePropertyAwareTrait;
diff --git a/src/Api/Management/Entity/Organization.php b/src/Api/Management/Entity/Organization.php
index adcbe7c3b..d6b843c48 100644
--- a/src/Api/Management/Entity/Organization.php
+++ b/src/Api/Management/Entity/Organization.php
@@ -33,7 +33,7 @@
/**
* Describes an Organization entity.
*/
-class Organization extends Entity implements OrganizationInterface
+final class Organization extends Entity implements OrganizationInterface
{
use DisplayNamePropertyAwareTrait;
use CommonEntityPropertiesAwareTrait;
diff --git a/src/Api/Management/Exception/DeveloperNotFoundException.php b/src/Api/Management/Exception/DeveloperNotFoundException.php
index 80e3c9d72..ed4687fef 100644
--- a/src/Api/Management/Exception/DeveloperNotFoundException.php
+++ b/src/Api/Management/Exception/DeveloperNotFoundException.php
@@ -23,6 +23,6 @@
/**
* Class DeveloperNotFoundException.
*/
-class DeveloperNotFoundException extends ApiResponseException
+final class DeveloperNotFoundException extends ApiResponseException
{
}
diff --git a/src/Api/Management/Normalizer/AppCredentialNormalizer.php b/src/Api/Management/Normalizer/AppCredentialNormalizer.php
index 367481861..08ad77cb9 100644
--- a/src/Api/Management/Normalizer/AppCredentialNormalizer.php
+++ b/src/Api/Management/Normalizer/AppCredentialNormalizer.php
@@ -20,12 +20,13 @@
use Apigee\Edge\Api\Management\Entity\AppCredentialInterface;
use Apigee\Edge\Normalizer\ObjectNormalizer;
+use ArrayObject;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
/**
* Class AppCredentialNormalizer.
*/
-class AppCredentialNormalizer extends ObjectNormalizer implements NormalizerInterface
+final class AppCredentialNormalizer extends ObjectNormalizer implements NormalizerInterface
{
/**
* {@inheritdoc}
@@ -41,7 +42,7 @@ 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($data, $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($data, $format, $context);
diff --git a/src/Api/Management/Normalizer/AppNormalizer.php b/src/Api/Management/Normalizer/AppNormalizer.php
index f0f658d51..7ba7be51e 100644
--- a/src/Api/Management/Normalizer/AppNormalizer.php
+++ b/src/Api/Management/Normalizer/AppNormalizer.php
@@ -20,12 +20,13 @@
use Apigee\Edge\Api\Management\Entity\AppInterface;
use Apigee\Edge\Normalizer\ObjectNormalizer;
+use ArrayObject;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
/**
* Class AppNormalizer.
*/
-class AppNormalizer extends ObjectNormalizer implements NormalizerInterface
+final class AppNormalizer extends ObjectNormalizer implements NormalizerInterface
{
/**
* {@inheritdoc}
@@ -41,7 +42,7 @@ 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($data, $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($data, $format, $context);
diff --git a/src/Api/Management/Normalizer/CompanyMembershipNormalizer.php b/src/Api/Management/Normalizer/CompanyMembershipNormalizer.php
index b2b3a34db..061322546 100644
--- a/src/Api/Management/Normalizer/CompanyMembershipNormalizer.php
+++ b/src/Api/Management/Normalizer/CompanyMembershipNormalizer.php
@@ -19,9 +19,10 @@
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
+final class CompanyMembershipNormalizer implements NormalizerInterface
{
/**
* {@inheritdoc}
@@ -29,7 +30,7 @@ class CompanyMembershipNormalizer implements NormalizerInterface
* @psalm-suppress InvalidReturnType Returning an object here is required
* for creating a valid Apigee Edge request.
*/
- public function normalize($data, $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' => [],
@@ -39,9 +40,9 @@ public function normalize($data, $format = null, array $context = []): array|str
$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);
+ return new ArrayObject($normalized, ArrayObject::ARRAY_AS_PROPS);
}
/**
diff --git a/src/Api/Management/Query/StatsQuery.php b/src/Api/Management/Query/StatsQuery.php
index 8ee912dd1..043623424 100644
--- a/src/Api/Management/Query/StatsQuery.php
+++ b/src/Api/Management/Query/StatsQuery.php
@@ -23,7 +23,7 @@
/**
* Class StatsQuery.
*/
-class StatsQuery implements StatsQueryInterface
+final class StatsQuery implements StatsQueryInterface
{
public const SORT_ASC = 'ASC';
diff --git a/src/Api/Management/Query/StatsQueryNormalizer.php b/src/Api/Management/Query/StatsQueryNormalizer.php
index c1e82bbea..386e70f26 100644
--- a/src/Api/Management/Query/StatsQueryNormalizer.php
+++ b/src/Api/Management/Query/StatsQueryNormalizer.php
@@ -19,6 +19,7 @@
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;
@@ -30,7 +31,7 @@
*
* Normalizes StatsQueryInterface objects to an array that can be passed to the Stats API as query parameter.
*/
-class StatsQueryNormalizer implements NormalizerInterface
+final class StatsQueryNormalizer implements NormalizerInterface
{
public const DATE_FORMAT = 'm/d/Y H:i';
@@ -52,7 +53,7 @@ public function __construct()
/**
* {@inheritdoc}
*/
- public function normalize($data, $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 StatsQueryInterface $data */
// Transform the object to JSON and back to an array to keep boolean values as boolean.
diff --git a/src/Api/Management/Serializer/ApiProductSerializer.php b/src/Api/Management/Serializer/ApiProductSerializer.php
index 86a97bcb5..3b2858c07 100644
--- a/src/Api/Management/Serializer/ApiProductSerializer.php
+++ b/src/Api/Management/Serializer/ApiProductSerializer.php
@@ -18,6 +18,6 @@
namespace Apigee\Edge\Api\Management\Serializer;
-class ApiProductSerializer extends AttributesPropertyAwareEntitySerializer
+final class ApiProductSerializer extends AttributesPropertyAwareEntitySerializer
{
}
diff --git a/src/Api/Management/Serializer/AppCredentialSerializer.php b/src/Api/Management/Serializer/AppCredentialSerializer.php
index f80ff8051..6dacc03fe 100644
--- a/src/Api/Management/Serializer/AppCredentialSerializer.php
+++ b/src/Api/Management/Serializer/AppCredentialSerializer.php
@@ -22,7 +22,7 @@
use Apigee\Edge\Denormalizer\CredentialProductDenormalizer;
use Apigee\Edge\Normalizer\CredentialProductNormalizer;
-class AppCredentialSerializer extends AttributesPropertyAwareEntitySerializer
+final class AppCredentialSerializer extends AttributesPropertyAwareEntitySerializer
{
/**
* AppCredentialSerializer constructor.
diff --git a/src/Api/Management/Serializer/AppEntitySerializer.php b/src/Api/Management/Serializer/AppEntitySerializer.php
index abc35d8f3..dde164f27 100644
--- a/src/Api/Management/Serializer/AppEntitySerializer.php
+++ b/src/Api/Management/Serializer/AppEntitySerializer.php
@@ -26,7 +26,7 @@
use Apigee\Edge\Normalizer\CredentialProductNormalizer;
use Apigee\Edge\Serializer\EntitySerializer;
-class AppEntitySerializer extends EntitySerializer
+final class AppEntitySerializer extends EntitySerializer
{
/**
* AppEntitySerializer constructor.
diff --git a/src/Api/Management/Serializer/CompanyMembershipSerializer.php b/src/Api/Management/Serializer/CompanyMembershipSerializer.php
index f9d298a86..78fe90457 100644
--- a/src/Api/Management/Serializer/CompanyMembershipSerializer.php
+++ b/src/Api/Management/Serializer/CompanyMembershipSerializer.php
@@ -22,7 +22,7 @@
use Apigee\Edge\Api\Management\Normalizer\CompanyMembershipNormalizer;
use Apigee\Edge\Serializer\EntitySerializer;
-class CompanyMembershipSerializer extends EntitySerializer
+final class CompanyMembershipSerializer extends EntitySerializer
{
/**
* CompanyMembershipSerializer constructor.
diff --git a/src/Api/Management/Serializer/CompanySerializer.php b/src/Api/Management/Serializer/CompanySerializer.php
index 9a062647b..fe5c3056a 100644
--- a/src/Api/Management/Serializer/CompanySerializer.php
+++ b/src/Api/Management/Serializer/CompanySerializer.php
@@ -18,6 +18,6 @@
namespace Apigee\Edge\Api\Management\Serializer;
-class CompanySerializer extends AttributesPropertyAwareEntitySerializer
+final class CompanySerializer extends AttributesPropertyAwareEntitySerializer
{
}
diff --git a/src/Api/Management/Serializer/DeveloperSerializer.php b/src/Api/Management/Serializer/DeveloperSerializer.php
index 3d76fa129..731cbcf3d 100644
--- a/src/Api/Management/Serializer/DeveloperSerializer.php
+++ b/src/Api/Management/Serializer/DeveloperSerializer.php
@@ -18,6 +18,6 @@
namespace Apigee\Edge\Api\Management\Serializer;
-class DeveloperSerializer extends AttributesPropertyAwareEntitySerializer
+final class DeveloperSerializer extends AttributesPropertyAwareEntitySerializer
{
}
diff --git a/src/Api/Management/Serializer/EnvironmentSerializer.php b/src/Api/Management/Serializer/EnvironmentSerializer.php
index 4e117d644..fcd405eef 100644
--- a/src/Api/Management/Serializer/EnvironmentSerializer.php
+++ b/src/Api/Management/Serializer/EnvironmentSerializer.php
@@ -18,6 +18,6 @@
namespace Apigee\Edge\Api\Management\Serializer;
-class EnvironmentSerializer extends PropertiesPropertyAwareEntitySerializer
+final class EnvironmentSerializer extends PropertiesPropertyAwareEntitySerializer
{
}
diff --git a/src/Api/Management/Serializer/OrganizationSerializer.php b/src/Api/Management/Serializer/OrganizationSerializer.php
index bf81d45fd..78a32ff37 100644
--- a/src/Api/Management/Serializer/OrganizationSerializer.php
+++ b/src/Api/Management/Serializer/OrganizationSerializer.php
@@ -18,6 +18,6 @@
namespace Apigee\Edge\Api\Management\Serializer;
-class OrganizationSerializer extends PropertiesPropertyAwareEntitySerializer
+final class OrganizationSerializer extends PropertiesPropertyAwareEntitySerializer
{
}
diff --git a/src/Api/Monetization/Controller/AcceptedRatePlanController.php b/src/Api/Monetization/Controller/AcceptedRatePlanController.php
index 378b6022b..d24c7590b 100644
--- a/src/Api/Monetization/Controller/AcceptedRatePlanController.php
+++ b/src/Api/Monetization/Controller/AcceptedRatePlanController.php
@@ -99,7 +99,7 @@ public function acceptRatePlan(RatePlanInterface $ratePlan, DateTimeImmutable $s
if (null !== $waveTerminationCharge) {
$tmp['waveTerminationCharge'] = $waveTerminationCharge ? 'true' : 'false';
}
- $payload = json_encode($tmp);
+ $payload = (string) json_encode($tmp);
$response = $this->client->post($this->getBaseEndpointUri(), $payload);
$this->getEntitySerializer()->setPropertiesFromResponse($response, $acceptedRatePlan);
@@ -122,7 +122,7 @@ public function updateSubscription(AcceptedRatePlanInterface $acceptedRatePlan,
$tmp['waveTerminationCharge'] = $waveTerminationCharge ? 'true' : 'false';
}
$this->alterRequestPayload($tmp, $acceptedRatePlan);
- $payload = json_encode($tmp);
+ $payload = (string) json_encode($tmp);
// Update an existing entity.
$response = $this->client->put($this->getEntityEndpointUri($acceptedRatePlan->id()), $payload);
$this->getEntitySerializer()->setPropertiesFromResponse($response, $acceptedRatePlan);
diff --git a/src/Api/Monetization/Controller/ApiPackageController.php b/src/Api/Monetization/Controller/ApiPackageController.php
index 03044e040..d955b7c14 100644
--- a/src/Api/Monetization/Controller/ApiPackageController.php
+++ b/src/Api/Monetization/Controller/ApiPackageController.php
@@ -27,7 +27,7 @@
use Apigee\Edge\Serializer\EntitySerializerInterface;
use Psr\Http\Message\UriInterface;
-class ApiPackageController extends OrganizationAwareEntityController implements ApiPackageControllerInterface
+final class ApiPackageController extends OrganizationAwareEntityController implements ApiPackageControllerInterface
{
use EntityCreateOperationControllerTrait;
use EntityDeleteOperationControllerTrait;
diff --git a/src/Api/Monetization/Controller/ApiProductController.php b/src/Api/Monetization/Controller/ApiProductController.php
index 16a769faf..8245a387d 100644
--- a/src/Api/Monetization/Controller/ApiProductController.php
+++ b/src/Api/Monetization/Controller/ApiProductController.php
@@ -23,7 +23,7 @@
use Apigee\Edge\Controller\EntityLoadOperationControllerTrait;
use Psr\Http\Message\UriInterface;
-class ApiProductController extends OrganizationAwareEntityController implements ApiProductControllerInterface
+final class ApiProductController extends OrganizationAwareEntityController implements ApiProductControllerInterface
{
use EntityListingControllerTrait;
use EntityLoadOperationControllerTrait;
diff --git a/src/Api/Monetization/Controller/CompanyAcceptedRatePlanController.php b/src/Api/Monetization/Controller/CompanyAcceptedRatePlanController.php
index 597b0f8c8..d1e9fd74f 100644
--- a/src/Api/Monetization/Controller/CompanyAcceptedRatePlanController.php
+++ b/src/Api/Monetization/Controller/CompanyAcceptedRatePlanController.php
@@ -24,7 +24,7 @@
use Apigee\Edge\Serializer\EntitySerializerInterface;
use Psr\Http\Message\UriInterface;
-class CompanyAcceptedRatePlanController extends AcceptedRatePlanController
+final class CompanyAcceptedRatePlanController extends AcceptedRatePlanController
{
/**
* Name of the company.
diff --git a/src/Api/Monetization/Controller/CompanyActiveRatePlanController.php b/src/Api/Monetization/Controller/CompanyActiveRatePlanController.php
index 03e4edb82..6f56c3d6f 100644
--- a/src/Api/Monetization/Controller/CompanyActiveRatePlanController.php
+++ b/src/Api/Monetization/Controller/CompanyActiveRatePlanController.php
@@ -22,7 +22,7 @@
use Apigee\Edge\Serializer\EntitySerializerInterface;
use Psr\Http\Message\UriInterface;
-class CompanyActiveRatePlanController extends ActiveRatePlanController
+final class CompanyActiveRatePlanController extends ActiveRatePlanController
{
/**
* Name of the company.
diff --git a/src/Api/Monetization/Controller/CompanyController.php b/src/Api/Monetization/Controller/CompanyController.php
index 721fdf655..8febda14f 100644
--- a/src/Api/Monetization/Controller/CompanyController.php
+++ b/src/Api/Monetization/Controller/CompanyController.php
@@ -26,7 +26,7 @@
* The endpoint currently returns both developers and companies, this may
* change later!
*/
-class CompanyController extends LegalEntityController implements CompanyControllerInterface
+final class CompanyController extends LegalEntityController implements CompanyControllerInterface
{
/**
* {@inheritdoc}
diff --git a/src/Api/Monetization/Controller/CompanyPrepaidBalanceController.php b/src/Api/Monetization/Controller/CompanyPrepaidBalanceController.php
index 37c66ac29..30ba05b90 100644
--- a/src/Api/Monetization/Controller/CompanyPrepaidBalanceController.php
+++ b/src/Api/Monetization/Controller/CompanyPrepaidBalanceController.php
@@ -20,7 +20,7 @@
use Psr\Http\Message\UriInterface;
-class CompanyPrepaidBalanceController extends PrepaidBalanceController implements CompanyPrepaidBalanceControllerInterface
+final class CompanyPrepaidBalanceController extends PrepaidBalanceController implements CompanyPrepaidBalanceControllerInterface
{
/**
* Name of the company.
diff --git a/src/Api/Monetization/Controller/CompanyReportDefinitionController.php b/src/Api/Monetization/Controller/CompanyReportDefinitionController.php
index fabcd9324..486715dae 100644
--- a/src/Api/Monetization/Controller/CompanyReportDefinitionController.php
+++ b/src/Api/Monetization/Controller/CompanyReportDefinitionController.php
@@ -23,7 +23,7 @@
use Apigee\Edge\Serializer\EntitySerializerInterface;
use Psr\Http\Message\UriInterface;
-class CompanyReportDefinitionController extends LegalEntityReportDefinitionController implements CompanyReportDefinitionControllerInterface
+final class CompanyReportDefinitionController extends LegalEntityReportDefinitionController implements CompanyReportDefinitionControllerInterface
{
/**
* @var string
diff --git a/src/Api/Monetization/Controller/CompanyTermsAndConditionsController.php b/src/Api/Monetization/Controller/CompanyTermsAndConditionsController.php
index 50166d477..08d9f828e 100644
--- a/src/Api/Monetization/Controller/CompanyTermsAndConditionsController.php
+++ b/src/Api/Monetization/Controller/CompanyTermsAndConditionsController.php
@@ -22,7 +22,7 @@
use Apigee\Edge\Serializer\EntitySerializerInterface;
use Psr\Http\Message\UriInterface;
-class CompanyTermsAndConditionsController extends LegalEntityTermsAndConditionsController
+final class CompanyTermsAndConditionsController extends LegalEntityTermsAndConditionsController
{
/**
* Name of the company.
diff --git a/src/Api/Monetization/Controller/DeveloperAcceptedRatePlanController.php b/src/Api/Monetization/Controller/DeveloperAcceptedRatePlanController.php
index 63c5a5de7..258b9a644 100644
--- a/src/Api/Monetization/Controller/DeveloperAcceptedRatePlanController.php
+++ b/src/Api/Monetization/Controller/DeveloperAcceptedRatePlanController.php
@@ -25,7 +25,7 @@
use Apigee\Edge\Serializer\EntitySerializerInterface;
use Psr\Http\Message\UriInterface;
-class DeveloperAcceptedRatePlanController extends AcceptedRatePlanController
+final class DeveloperAcceptedRatePlanController extends AcceptedRatePlanController
{
/**
* UUID or email address of a developer.
diff --git a/src/Api/Monetization/Controller/DeveloperActiveRatePlanController.php b/src/Api/Monetization/Controller/DeveloperActiveRatePlanController.php
index 8fbf45381..b7bd76fdc 100644
--- a/src/Api/Monetization/Controller/DeveloperActiveRatePlanController.php
+++ b/src/Api/Monetization/Controller/DeveloperActiveRatePlanController.php
@@ -22,7 +22,7 @@
use Apigee\Edge\Serializer\EntitySerializerInterface;
use Psr\Http\Message\UriInterface;
-class DeveloperActiveRatePlanController extends ActiveRatePlanController
+final class DeveloperActiveRatePlanController extends ActiveRatePlanController
{
/**
* UUID or email address of a developer.
diff --git a/src/Api/Monetization/Controller/DeveloperController.php b/src/Api/Monetization/Controller/DeveloperController.php
index 9754a7952..e5834e645 100644
--- a/src/Api/Monetization/Controller/DeveloperController.php
+++ b/src/Api/Monetization/Controller/DeveloperController.php
@@ -26,7 +26,7 @@
* The endpoint currently returns both developers and companies, this may
* change later!
*/
-class DeveloperController extends LegalEntityController implements DeveloperControllerInterface
+final class DeveloperController extends LegalEntityController implements DeveloperControllerInterface
{
use PaginatedListingHelperTrait;
diff --git a/src/Api/Monetization/Controller/DeveloperPrepaidBalanceController.php b/src/Api/Monetization/Controller/DeveloperPrepaidBalanceController.php
index a779428bc..b5be576ec 100644
--- a/src/Api/Monetization/Controller/DeveloperPrepaidBalanceController.php
+++ b/src/Api/Monetization/Controller/DeveloperPrepaidBalanceController.php
@@ -22,7 +22,7 @@
use Apigee\Edge\Serializer\EntitySerializerInterface;
use Psr\Http\Message\UriInterface;
-class DeveloperPrepaidBalanceController extends PrepaidBalanceController implements DeveloperPrepaidBalanceControllerInterface
+final class DeveloperPrepaidBalanceController extends PrepaidBalanceController implements DeveloperPrepaidBalanceControllerInterface
{
/**
* UUID or email address of a developer.
diff --git a/src/Api/Monetization/Controller/DeveloperReportDefinitionController.php b/src/Api/Monetization/Controller/DeveloperReportDefinitionController.php
index 25096c5c8..8e086feee 100644
--- a/src/Api/Monetization/Controller/DeveloperReportDefinitionController.php
+++ b/src/Api/Monetization/Controller/DeveloperReportDefinitionController.php
@@ -23,7 +23,7 @@
use Apigee\Edge\Serializer\EntitySerializerInterface;
use Psr\Http\Message\UriInterface;
-class DeveloperReportDefinitionController extends LegalEntityReportDefinitionController implements DeveloperReportDefinitionControllerInterface
+final class DeveloperReportDefinitionController extends LegalEntityReportDefinitionController implements DeveloperReportDefinitionControllerInterface
{
/**
* @var string
diff --git a/src/Api/Monetization/Controller/DeveloperRoleController.php b/src/Api/Monetization/Controller/DeveloperRoleController.php
index 554621e8f..306b6f1c2 100644
--- a/src/Api/Monetization/Controller/DeveloperRoleController.php
+++ b/src/Api/Monetization/Controller/DeveloperRoleController.php
@@ -22,7 +22,7 @@
use Apigee\Edge\Controller\EntityListingControllerTrait;
use Psr\Http\Message\UriInterface;
-class DeveloperRoleController extends OrganizationAwareEntityController implements DeveloperRoleControllerInterface
+final class DeveloperRoleController extends OrganizationAwareEntityController implements DeveloperRoleControllerInterface
{
use EntityCreateOperationControllerTrait;
use EntityListingControllerTrait;
diff --git a/src/Api/Monetization/Controller/DeveloperTermsAndConditionsController.php b/src/Api/Monetization/Controller/DeveloperTermsAndConditionsController.php
index 98b4b567f..bb3638124 100644
--- a/src/Api/Monetization/Controller/DeveloperTermsAndConditionsController.php
+++ b/src/Api/Monetization/Controller/DeveloperTermsAndConditionsController.php
@@ -22,7 +22,7 @@
use Apigee\Edge\Serializer\EntitySerializerInterface;
use Psr\Http\Message\UriInterface;
-class DeveloperTermsAndConditionsController extends LegalEntityTermsAndConditionsController
+final class DeveloperTermsAndConditionsController extends LegalEntityTermsAndConditionsController
{
/**
* @var string
diff --git a/src/Api/Monetization/Controller/LegalEntityTermsAndConditionsControllerInterface.php b/src/Api/Monetization/Controller/LegalEntityTermsAndConditionsControllerInterface.php
index c6030d93f..0e0c89136 100644
--- a/src/Api/Monetization/Controller/LegalEntityTermsAndConditionsControllerInterface.php
+++ b/src/Api/Monetization/Controller/LegalEntityTermsAndConditionsControllerInterface.php
@@ -42,7 +42,7 @@ public function getTermsAndConditionsHistory(): array;
*
* Specifying audit date is omitted at this moment.
*
- * @see \Apigee\Edge\Api\Monetization\Structure\LegalEntityTermsAndConditionsHistoryItem::$auditDate
+ * @see LegalEntityTermsAndConditionsHistoryItem::$auditDate
*
* @param string $tncId
* Id of a terms and conditions.
@@ -56,7 +56,7 @@ public function acceptTermsAndConditionsById(string $tncId): LegalEntityTermsAnd
*
* Specifying audit date is omitted at this moment.
*
- * @see \Apigee\Edge\Api\Monetization\Structure\LegalEntityTermsAndConditionsHistoryItem::$auditDate
+ * @see LegalEntityTermsAndConditionsHistoryItem::$auditDate
*
* @param string $tncId
* Id of a terms and conditions.
diff --git a/src/Api/Monetization/Controller/OrganizationProfileController.php b/src/Api/Monetization/Controller/OrganizationProfileController.php
index 0ed878881..818dc73c9 100644
--- a/src/Api/Monetization/Controller/OrganizationProfileController.php
+++ b/src/Api/Monetization/Controller/OrganizationProfileController.php
@@ -27,7 +27,7 @@
use Apigee\Edge\Serializer\EntitySerializerInterface;
use Psr\Http\Message\UriInterface;
-class OrganizationProfileController extends EntityController implements OrganizationProfileControllerInterface
+final class OrganizationProfileController extends EntityController implements OrganizationProfileControllerInterface
{
use EntityLoadOperationControllerTrait;
use EntityUpdateOperationControllerTrait;
diff --git a/src/Api/Monetization/Controller/PaymentProviderController.php b/src/Api/Monetization/Controller/PaymentProviderController.php
index 782fc148d..c0b655eb6 100644
--- a/src/Api/Monetization/Controller/PaymentProviderController.php
+++ b/src/Api/Monetization/Controller/PaymentProviderController.php
@@ -22,7 +22,7 @@
use Apigee\Edge\Controller\EntityListingControllerTrait;
use Psr\Http\Message\UriInterface;
-class PaymentProviderController extends OrganizationAwareEntityController implements PaymentProviderControllerInterface
+final class PaymentProviderController extends OrganizationAwareEntityController implements PaymentProviderControllerInterface
{
use EntityCrudOperationsControllerTrait;
use EntityListingControllerAwareTrait;
diff --git a/src/Api/Monetization/Controller/RatePlanController.php b/src/Api/Monetization/Controller/RatePlanController.php
index 148ab2e3e..17b06f295 100644
--- a/src/Api/Monetization/Controller/RatePlanController.php
+++ b/src/Api/Monetization/Controller/RatePlanController.php
@@ -28,7 +28,7 @@
use Apigee\Edge\Serializer\EntitySerializerInterface;
use Psr\Http\Message\UriInterface;
-class RatePlanController extends OrganizationAwareEntityController implements RatePlanControllerInterface
+final class RatePlanController extends OrganizationAwareEntityController implements RatePlanControllerInterface
{
use EntityCrudOperationsControllerTrait {
buildEntityCreatePayload as private traitBuildContextForEntityTransformerInCreate;
@@ -79,6 +79,9 @@ public function getEntities(?bool $showCurrentOnly = null, ?bool $showPrivate =
$responseArray = $this->responseToArray($response);
// Ignore entity type key from response, ex.: product.
$responseArray = reset($responseArray);
+ if (!is_array($responseArray)) {
+ $responseArray = [];
+ }
return $this->responseArrayToArrayOfEntities($responseArray);
}
@@ -94,7 +97,7 @@ public function getEntities(?bool $showCurrentOnly = null, ?bool $showPrivate =
public function createNewRevision(RatePlanRevisionInterface $entity): void
{
$payload = $this->getEntitySerializer()->serialize($entity, 'json');
- $response = $this->getClient()->post($this->getEntityEndpointUri($entity->getPreviousRatePlanRevision()->id()) . '/revision', $payload);
+ $response = $this->getClient()->post((string) $this->getEntityEndpointUri($entity->getPreviousRatePlanRevision()->id()) . '/revision', $payload);
$this->getEntitySerializer()->setPropertiesFromResponse($response, $entity);
}
diff --git a/src/Api/Monetization/Controller/ReportDefinitionController.php b/src/Api/Monetization/Controller/ReportDefinitionController.php
index 44aa36520..2484fc6a4 100644
--- a/src/Api/Monetization/Controller/ReportDefinitionController.php
+++ b/src/Api/Monetization/Controller/ReportDefinitionController.php
@@ -28,7 +28,7 @@
use Apigee\Edge\Utility\ResponseToArrayHelper;
use Psr\Http\Message\UriInterface;
-class ReportDefinitionController extends OrganizationAwareEntityController implements ReportDefinitionControllerInterface
+final class ReportDefinitionController extends OrganizationAwareEntityController implements ReportDefinitionControllerInterface
{
use EntityCrudOperationsControllerTrait;
use EntityListingControllerAwareTrait;
diff --git a/src/Api/Monetization/Controller/SupportedCurrencyController.php b/src/Api/Monetization/Controller/SupportedCurrencyController.php
index 6fe2704e0..432712b2c 100644
--- a/src/Api/Monetization/Controller/SupportedCurrencyController.php
+++ b/src/Api/Monetization/Controller/SupportedCurrencyController.php
@@ -25,7 +25,7 @@
use Apigee\Edge\Serializer\EntitySerializerInterface;
use Psr\Http\Message\UriInterface;
-class SupportedCurrencyController extends OrganizationAwareEntityController implements SupportedCurrencyControllerInterface
+final class SupportedCurrencyController extends OrganizationAwareEntityController implements SupportedCurrencyControllerInterface
{
use EntityCrudOperationsControllerTrait;
use EntityListingControllerTrait;
diff --git a/src/Api/Monetization/Controller/TermsAndConditionsController.php b/src/Api/Monetization/Controller/TermsAndConditionsController.php
index 9784b312c..a18cc9ce9 100644
--- a/src/Api/Monetization/Controller/TermsAndConditionsController.php
+++ b/src/Api/Monetization/Controller/TermsAndConditionsController.php
@@ -25,7 +25,7 @@
use Apigee\Edge\Serializer\EntitySerializerInterface;
use Psr\Http\Message\UriInterface;
-class TermsAndConditionsController extends OrganizationAwareEntityController implements TermsAndConditionsControllerInterface
+final class TermsAndConditionsController extends OrganizationAwareEntityController implements TermsAndConditionsControllerInterface
{
use EntityCrudOperationsControllerTrait;
use EntityListingControllerTrait;
diff --git a/src/Api/Monetization/Denormalizer/AcceptedRatePlanDenormalizer.php b/src/Api/Monetization/Denormalizer/AcceptedRatePlanDenormalizer.php
index f20502a68..a1ca8f083 100644
--- a/src/Api/Monetization/Denormalizer/AcceptedRatePlanDenormalizer.php
+++ b/src/Api/Monetization/Denormalizer/AcceptedRatePlanDenormalizer.php
@@ -52,6 +52,6 @@ public function supportsDenormalization($data, $type, $format = null, array $con
return false;
}
- return AcceptedRatePlanInterface::class === $type || $type instanceof AcceptedRatePlanInterface || in_array(AcceptedRatePlanInterface::class, class_implements($type));
+ return AcceptedRatePlanInterface::class === $type || $type instanceof AcceptedRatePlanInterface || in_array(AcceptedRatePlanInterface::class, class_implements($type) ?: []);
}
}
diff --git a/src/Api/Monetization/Denormalizer/AddressDenormalizer.php b/src/Api/Monetization/Denormalizer/AddressDenormalizer.php
index ff01ca43d..bcb6e2176 100644
--- a/src/Api/Monetization/Denormalizer/AddressDenormalizer.php
+++ b/src/Api/Monetization/Denormalizer/AddressDenormalizer.php
@@ -26,7 +26,7 @@
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class AddressDenormalizer extends ObjectDenormalizer
+final class AddressDenormalizer extends ObjectDenormalizer
{
/**
* AddressDenormalizer constructor.
diff --git a/src/Api/Monetization/Denormalizer/ApiPackageDenormalizer.php b/src/Api/Monetization/Denormalizer/ApiPackageDenormalizer.php
index 2eaa8ec66..ef6eb3997 100644
--- a/src/Api/Monetization/Denormalizer/ApiPackageDenormalizer.php
+++ b/src/Api/Monetization/Denormalizer/ApiPackageDenormalizer.php
@@ -26,7 +26,7 @@
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class ApiPackageDenormalizer extends ObjectDenormalizer
+final class ApiPackageDenormalizer extends ObjectDenormalizer
{
/**
* ApiPackageDenormalizer constructor.
@@ -52,6 +52,6 @@ public function supportsDenormalization($data, $type, $format = null, array $con
return false;
}
- return ApiPackageInterface::class === $type || $type instanceof ApiPackageInterface || in_array(ApiPackageInterface::class, class_implements($type));
+ return ApiPackageInterface::class === $type || $type instanceof ApiPackageInterface || in_array(ApiPackageInterface::class, class_implements($type) ?: []);
}
}
diff --git a/src/Api/Monetization/Denormalizer/BalanceDenormalizer.php b/src/Api/Monetization/Denormalizer/BalanceDenormalizer.php
index c3dbae56d..8b13b47fc 100644
--- a/src/Api/Monetization/Denormalizer/BalanceDenormalizer.php
+++ b/src/Api/Monetization/Denormalizer/BalanceDenormalizer.php
@@ -26,7 +26,7 @@
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class BalanceDenormalizer extends ObjectDenormalizer
+final class BalanceDenormalizer extends ObjectDenormalizer
{
/**
* BalanceDenormalizer constructor.
@@ -52,6 +52,6 @@ public function supportsDenormalization($data, $type, $format = null, array $con
return false;
}
- return BalanceInterface::class === $type || $type instanceof BalanceInterface || in_array(BalanceInterface::class, class_implements($type));
+ return BalanceInterface::class === $type || $type instanceof BalanceInterface || in_array(BalanceInterface::class, class_implements($type) ?: []);
}
}
diff --git a/src/Api/Monetization/Denormalizer/CompanyAcceptedRatePlanDenormalizer.php b/src/Api/Monetization/Denormalizer/CompanyAcceptedRatePlanDenormalizer.php
index 2516f237b..031967811 100644
--- a/src/Api/Monetization/Denormalizer/CompanyAcceptedRatePlanDenormalizer.php
+++ b/src/Api/Monetization/Denormalizer/CompanyAcceptedRatePlanDenormalizer.php
@@ -25,7 +25,7 @@
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class CompanyAcceptedRatePlanDenormalizer extends AcceptedRatePlanDenormalizer
+final class CompanyAcceptedRatePlanDenormalizer extends AcceptedRatePlanDenormalizer
{
/**
* Fully qualified class name of the company accepted rate plan entity.
diff --git a/src/Api/Monetization/Denormalizer/CompanyPaymentTransactionDenormalizer.php b/src/Api/Monetization/Denormalizer/CompanyPaymentTransactionDenormalizer.php
index 829b600ba..94c2de730 100644
--- a/src/Api/Monetization/Denormalizer/CompanyPaymentTransactionDenormalizer.php
+++ b/src/Api/Monetization/Denormalizer/CompanyPaymentTransactionDenormalizer.php
@@ -25,7 +25,7 @@
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class CompanyPaymentTransactionDenormalizer extends PaymentTransactionDenormalizer
+final class CompanyPaymentTransactionDenormalizer extends PaymentTransactionDenormalizer
{
/**
* Fully qualified class name of the company payment transaction object.
diff --git a/src/Api/Monetization/Denormalizer/CompanyRatePlanDenormalizer.php b/src/Api/Monetization/Denormalizer/CompanyRatePlanDenormalizer.php
index bfb46031f..7e2cecf4b 100644
--- a/src/Api/Monetization/Denormalizer/CompanyRatePlanDenormalizer.php
+++ b/src/Api/Monetization/Denormalizer/CompanyRatePlanDenormalizer.php
@@ -23,7 +23,7 @@
use Apigee\Edge\Api\Monetization\Entity\RatePlanInterface;
use Apigee\Edge\Api\Monetization\NameConverter\CompanyRatePlanNameConverter;
-class CompanyRatePlanDenormalizer extends RatePlanDenormalizer
+final class CompanyRatePlanDenormalizer extends RatePlanDenormalizer
{
/**
* Fully qualified class name of the company rate plan entity.
diff --git a/src/Api/Monetization/Denormalizer/CompanyReportDefinitionDenormalizer.php b/src/Api/Monetization/Denormalizer/CompanyReportDefinitionDenormalizer.php
index 459053a47..8bcaddcd2 100644
--- a/src/Api/Monetization/Denormalizer/CompanyReportDefinitionDenormalizer.php
+++ b/src/Api/Monetization/Denormalizer/CompanyReportDefinitionDenormalizer.php
@@ -25,7 +25,7 @@
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class CompanyReportDefinitionDenormalizer extends ReportDefinitionDenormalizer
+final class CompanyReportDefinitionDenormalizer extends ReportDefinitionDenormalizer
{
/**
* Fully qualified class name of the company report definition entity.
diff --git a/src/Api/Monetization/Denormalizer/DateTimeZoneDenormalizer.php b/src/Api/Monetization/Denormalizer/DateTimeZoneDenormalizer.php
index 800845ff5..faaa53741 100644
--- a/src/Api/Monetization/Denormalizer/DateTimeZoneDenormalizer.php
+++ b/src/Api/Monetization/Denormalizer/DateTimeZoneDenormalizer.php
@@ -23,7 +23,7 @@
use Symfony\Component\Serializer\Exception\UnexpectedValueException;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
-class DateTimeZoneDenormalizer implements DenormalizerInterface
+final class DateTimeZoneDenormalizer implements DenormalizerInterface
{
/**
* {@inheritdoc}
diff --git a/src/Api/Monetization/Denormalizer/DeveloperAcceptedRatePlanDenormalizer.php b/src/Api/Monetization/Denormalizer/DeveloperAcceptedRatePlanDenormalizer.php
index 861b568f0..80892d1d3 100644
--- a/src/Api/Monetization/Denormalizer/DeveloperAcceptedRatePlanDenormalizer.php
+++ b/src/Api/Monetization/Denormalizer/DeveloperAcceptedRatePlanDenormalizer.php
@@ -20,7 +20,7 @@
use Apigee\Edge\Api\Monetization\Entity\DeveloperAcceptedRatePlan;
-class DeveloperAcceptedRatePlanDenormalizer extends AcceptedRatePlanDenormalizer
+final class DeveloperAcceptedRatePlanDenormalizer extends AcceptedRatePlanDenormalizer
{
/**
* Fully qualified class name of the developer accepted rate plan entity.
diff --git a/src/Api/Monetization/Denormalizer/DeveloperCategoryRatePlanDenormalizer.php b/src/Api/Monetization/Denormalizer/DeveloperCategoryRatePlanDenormalizer.php
index aae2de996..a1184e8a6 100644
--- a/src/Api/Monetization/Denormalizer/DeveloperCategoryRatePlanDenormalizer.php
+++ b/src/Api/Monetization/Denormalizer/DeveloperCategoryRatePlanDenormalizer.php
@@ -22,7 +22,7 @@
use Apigee\Edge\Api\Monetization\Entity\DeveloperCategoryRatePlanRevision;
use Apigee\Edge\Api\Monetization\Entity\RatePlanInterface;
-class DeveloperCategoryRatePlanDenormalizer extends RatePlanDenormalizer
+final class DeveloperCategoryRatePlanDenormalizer extends RatePlanDenormalizer
{
/**
* Fully qualified class name of the developer category rate plan entity.
diff --git a/src/Api/Monetization/Denormalizer/DeveloperPaymentTransactionDenormalizer.php b/src/Api/Monetization/Denormalizer/DeveloperPaymentTransactionDenormalizer.php
index 005ca2fdd..a14f626a2 100644
--- a/src/Api/Monetization/Denormalizer/DeveloperPaymentTransactionDenormalizer.php
+++ b/src/Api/Monetization/Denormalizer/DeveloperPaymentTransactionDenormalizer.php
@@ -20,7 +20,7 @@
use Apigee\Edge\Api\Monetization\Structure\DeveloperPaymentTransaction;
-class DeveloperPaymentTransactionDenormalizer extends PaymentTransactionDenormalizer
+final class DeveloperPaymentTransactionDenormalizer extends PaymentTransactionDenormalizer
{
/**
* Fully qualified class name of the developer payment transaction object.
diff --git a/src/Api/Monetization/Denormalizer/DeveloperRatePlanDenormalizer.php b/src/Api/Monetization/Denormalizer/DeveloperRatePlanDenormalizer.php
index 035aa3949..552f3fc6c 100644
--- a/src/Api/Monetization/Denormalizer/DeveloperRatePlanDenormalizer.php
+++ b/src/Api/Monetization/Denormalizer/DeveloperRatePlanDenormalizer.php
@@ -22,7 +22,7 @@
use Apigee\Edge\Api\Monetization\Entity\DeveloperRatePlanRevision;
use Apigee\Edge\Api\Monetization\Entity\RatePlanInterface;
-class DeveloperRatePlanDenormalizer extends RatePlanDenormalizer
+final class DeveloperRatePlanDenormalizer extends RatePlanDenormalizer
{
/**
* Fully qualified class name of the developer rate plan entity.
diff --git a/src/Api/Monetization/Denormalizer/DeveloperReportDefinitionDenormalizer.php b/src/Api/Monetization/Denormalizer/DeveloperReportDefinitionDenormalizer.php
index 26d4d687c..8dbbefb16 100644
--- a/src/Api/Monetization/Denormalizer/DeveloperReportDefinitionDenormalizer.php
+++ b/src/Api/Monetization/Denormalizer/DeveloperReportDefinitionDenormalizer.php
@@ -20,7 +20,7 @@
use Apigee\Edge\Api\Monetization\Entity\DeveloperReportDefinition;
-class DeveloperReportDefinitionDenormalizer extends ReportDefinitionDenormalizer
+final class DeveloperReportDefinitionDenormalizer extends ReportDefinitionDenormalizer
{
/**
* Fully qualified class name of the developer report definition entity.
diff --git a/src/Api/Monetization/Denormalizer/LegalEntityDenormalizer.php b/src/Api/Monetization/Denormalizer/LegalEntityDenormalizer.php
index b60682b84..69cee3329 100644
--- a/src/Api/Monetization/Denormalizer/LegalEntityDenormalizer.php
+++ b/src/Api/Monetization/Denormalizer/LegalEntityDenormalizer.php
@@ -31,7 +31,7 @@
/**
* Dynamically denormalizes legal entities to developers or companies.
*/
-class LegalEntityDenormalizer extends ObjectDenormalizer
+final class LegalEntityDenormalizer extends ObjectDenormalizer
{
/**
* Fully qualified class name of the developer entity.
@@ -68,9 +68,9 @@ public function denormalize($data, $type, $format = null, array $context = []):
{
if ($data->isCompany) {
return parent::denormalize($data, $this->companyClass, $format, $context);
- } else {
- return parent::denormalize($data, $this->developerClass, $format, $context);
}
+
+ return parent::denormalize($data, $this->developerClass, $format, $context);
}
/**
@@ -83,6 +83,6 @@ public function supportsDenormalization($data, $type, $format = null, array $con
return false;
}
- return LegalEntityInterface::class === $type || $type instanceof LegalEntityInterface || in_array(LegalEntityInterface::class, class_implements($type));
+ return LegalEntityInterface::class === $type || $type instanceof LegalEntityInterface || in_array(LegalEntityInterface::class, class_implements($type) ?: []);
}
}
diff --git a/src/Api/Monetization/Denormalizer/OrganizationProfileDenormalizer.php b/src/Api/Monetization/Denormalizer/OrganizationProfileDenormalizer.php
index 49ff8e46c..1869556ba 100644
--- a/src/Api/Monetization/Denormalizer/OrganizationProfileDenormalizer.php
+++ b/src/Api/Monetization/Denormalizer/OrganizationProfileDenormalizer.php
@@ -26,7 +26,7 @@
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class OrganizationProfileDenormalizer extends ObjectDenormalizer
+final class OrganizationProfileDenormalizer extends ObjectDenormalizer
{
/**
* OrganizationProfileDenormalizer constructor.
@@ -52,6 +52,6 @@ public function supportsDenormalization($data, $type, $format = null, array $con
return false;
}
- return OrganizationProfileInterface::class === $type || $type instanceof OrganizationProfileInterface || in_array(OrganizationProfileInterface::class, class_implements($type));
+ return OrganizationProfileInterface::class === $type || $type instanceof OrganizationProfileInterface || in_array(OrganizationProfileInterface::class, class_implements($type) ?: []);
}
}
diff --git a/src/Api/Monetization/Denormalizer/PrepaidBalanceDenormalizer.php b/src/Api/Monetization/Denormalizer/PrepaidBalanceDenormalizer.php
index 17a5a0de8..66c2b23d3 100644
--- a/src/Api/Monetization/Denormalizer/PrepaidBalanceDenormalizer.php
+++ b/src/Api/Monetization/Denormalizer/PrepaidBalanceDenormalizer.php
@@ -26,7 +26,7 @@
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class PrepaidBalanceDenormalizer extends ObjectDenormalizer
+final class PrepaidBalanceDenormalizer extends ObjectDenormalizer
{
/**
* PrepaidBalanceDenormalizer constructor.
@@ -52,6 +52,6 @@ public function supportsDenormalization($data, $type, $format = null, array $con
return false;
}
- return PrepaidBalanceInterface::class === $type || $type instanceof PrepaidBalanceInterface || in_array(PrepaidBalanceInterface::class, class_implements($type));
+ return PrepaidBalanceInterface::class === $type || $type instanceof PrepaidBalanceInterface || in_array(PrepaidBalanceInterface::class, class_implements($type) ?: []);
}
}
diff --git a/src/Api/Monetization/Denormalizer/RatePlanDenormalizer.php b/src/Api/Monetization/Denormalizer/RatePlanDenormalizer.php
index ac4041eb2..54fc2e420 100644
--- a/src/Api/Monetization/Denormalizer/RatePlanDenormalizer.php
+++ b/src/Api/Monetization/Denormalizer/RatePlanDenormalizer.php
@@ -74,6 +74,6 @@ public function supportsDenormalization($data, $type, $format = null, array $con
return false;
}
- return RatePlanInterface::class === $type || $type instanceof RatePlanInterface || in_array(RatePlanInterface::class, class_implements($type));
+ return RatePlanInterface::class === $type || $type instanceof RatePlanInterface || in_array(RatePlanInterface::class, class_implements($type) ?: []);
}
}
diff --git a/src/Api/Monetization/Denormalizer/RatePlanDenormalizerFactory.php b/src/Api/Monetization/Denormalizer/RatePlanDenormalizerFactory.php
index 14092fe47..a1381cdb1 100644
--- a/src/Api/Monetization/Denormalizer/RatePlanDenormalizerFactory.php
+++ b/src/Api/Monetization/Denormalizer/RatePlanDenormalizerFactory.php
@@ -23,7 +23,7 @@
use Symfony\Component\Serializer\SerializerAwareTrait;
use Symfony\Component\Serializer\SerializerInterface;
-class RatePlanDenormalizerFactory implements DenormalizerInterface, SerializerAwareInterface
+final class RatePlanDenormalizerFactory implements DenormalizerInterface, SerializerAwareInterface
{
use SerializerAwareTrait {
setSerializer as private traitSetSerializer;
diff --git a/src/Api/Monetization/Denormalizer/RatePlanRateDenormalizer.php b/src/Api/Monetization/Denormalizer/RatePlanRateDenormalizer.php
index fd41c674b..f0b697aef 100644
--- a/src/Api/Monetization/Denormalizer/RatePlanRateDenormalizer.php
+++ b/src/Api/Monetization/Denormalizer/RatePlanRateDenormalizer.php
@@ -24,7 +24,7 @@
use Apigee\Edge\Denormalizer\ObjectDenormalizer;
use Symfony\Component\Serializer\Exception\UnexpectedValueException;
-class RatePlanRateDenormalizer extends ObjectDenormalizer
+final class RatePlanRateDenormalizer extends ObjectDenormalizer
{
protected $revShareClass = RatePlanRateRevShare::class;
diff --git a/src/Api/Monetization/Denormalizer/ReportCriteriaDenormalizer.php b/src/Api/Monetization/Denormalizer/ReportCriteriaDenormalizer.php
index c2a7e822a..d6a35c753 100644
--- a/src/Api/Monetization/Denormalizer/ReportCriteriaDenormalizer.php
+++ b/src/Api/Monetization/Denormalizer/ReportCriteriaDenormalizer.php
@@ -33,7 +33,7 @@
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class ReportCriteriaDenormalizer extends ObjectDenormalizer
+final class ReportCriteriaDenormalizer extends ObjectDenormalizer
{
use TimezoneFixerHelperTrait;
/**
diff --git a/src/Api/Monetization/Denormalizer/ReportDefinitionDenormalizer.php b/src/Api/Monetization/Denormalizer/ReportDefinitionDenormalizer.php
index d7f40bd95..d13d3faf0 100644
--- a/src/Api/Monetization/Denormalizer/ReportDefinitionDenormalizer.php
+++ b/src/Api/Monetization/Denormalizer/ReportDefinitionDenormalizer.php
@@ -52,6 +52,6 @@ public function supportsDenormalization($data, $type, $format = null, array $con
return false;
}
- return ReportDefinitionInterface::class === $type || $type instanceof ReportDefinitionInterface || in_array(ReportDefinitionInterface::class, class_implements($type));
+ return ReportDefinitionInterface::class === $type || $type instanceof ReportDefinitionInterface || in_array(ReportDefinitionInterface::class, class_implements($type) ?: []);
}
}
diff --git a/src/Api/Monetization/Denormalizer/StandardRatePlanDenormalizer.php b/src/Api/Monetization/Denormalizer/StandardRatePlanDenormalizer.php
index 7ca38279d..532c36c07 100644
--- a/src/Api/Monetization/Denormalizer/StandardRatePlanDenormalizer.php
+++ b/src/Api/Monetization/Denormalizer/StandardRatePlanDenormalizer.php
@@ -22,7 +22,7 @@
use Apigee\Edge\Api\Monetization\Entity\StandardRatePlan;
use Apigee\Edge\Api\Monetization\Entity\StandardRatePlanRevision;
-class StandardRatePlanDenormalizer extends RatePlanDenormalizer
+final class StandardRatePlanDenormalizer extends RatePlanDenormalizer
{
/**
* Fully qualified class name of the standard rate plan entity.
diff --git a/src/Api/Monetization/Denormalizer/SupportedCurrencyDenormalizer.php b/src/Api/Monetization/Denormalizer/SupportedCurrencyDenormalizer.php
index 66d1510e6..3865c581a 100644
--- a/src/Api/Monetization/Denormalizer/SupportedCurrencyDenormalizer.php
+++ b/src/Api/Monetization/Denormalizer/SupportedCurrencyDenormalizer.php
@@ -26,7 +26,7 @@
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class SupportedCurrencyDenormalizer extends ObjectDenormalizer
+final class SupportedCurrencyDenormalizer extends ObjectDenormalizer
{
/**
* SupportedCurrencyDenormalizer constructor.
@@ -52,6 +52,6 @@ public function supportsDenormalization($data, $type, $format = null, array $con
return false;
}
- return SupportedCurrencyInterface::class === $type || $type instanceof SupportedCurrencyInterface || in_array(SupportedCurrencyInterface::class, class_implements($type));
+ return SupportedCurrencyInterface::class === $type || $type instanceof SupportedCurrencyInterface || in_array(SupportedCurrencyInterface::class, class_implements($type) ?: []);
}
}
diff --git a/src/Api/Monetization/Denormalizer/TermsAndConditionsDenormalizer.php b/src/Api/Monetization/Denormalizer/TermsAndConditionsDenormalizer.php
index df9318853..e1892286b 100644
--- a/src/Api/Monetization/Denormalizer/TermsAndConditionsDenormalizer.php
+++ b/src/Api/Monetization/Denormalizer/TermsAndConditionsDenormalizer.php
@@ -27,7 +27,7 @@
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class TermsAndConditionsDenormalizer extends ObjectDenormalizer
+final class TermsAndConditionsDenormalizer extends ObjectDenormalizer
{
use TimezoneFixerHelperTrait;
@@ -71,6 +71,6 @@ public function supportsDenormalization($data, $type, $format = null, array $con
return false;
}
- return TermsAndConditionsInterface::class === $type || $type instanceof TermsAndConditionsInterface || in_array(TermsAndConditionsInterface::class, class_implements($type));
+ return TermsAndConditionsInterface::class === $type || $type instanceof TermsAndConditionsInterface || in_array(TermsAndConditionsInterface::class, class_implements($type) ?: []);
}
}
diff --git a/src/Api/Monetization/Entity/ApiPackage.php b/src/Api/Monetization/Entity/ApiPackage.php
index d607695a0..7475d7ccc 100644
--- a/src/Api/Monetization/Entity/ApiPackage.php
+++ b/src/Api/Monetization/Entity/ApiPackage.php
@@ -24,7 +24,7 @@
use Apigee\Edge\Entity\Property\NamePropertyAwareTrait;
use Apigee\Edge\Entity\Property\StatusPropertyAwareTrait;
-class ApiPackage extends OrganizationAwareEntity implements ApiPackageInterface
+final class ApiPackage extends OrganizationAwareEntity implements ApiPackageInterface
{
use ApiProductsPropertyAwareTrait;
use DescriptionPropertyAwareTrait;
diff --git a/src/Api/Monetization/Entity/ApiProduct.php b/src/Api/Monetization/Entity/ApiProduct.php
index 45fe328a9..b59805bf7 100644
--- a/src/Api/Monetization/Entity/ApiProduct.php
+++ b/src/Api/Monetization/Entity/ApiProduct.php
@@ -23,7 +23,7 @@
use Apigee\Edge\Entity\Property\NamePropertyAwareTrait;
use Apigee\Edge\Entity\Property\StatusPropertyAwareTrait;
-class ApiProduct extends OrganizationAwareEntity implements ApiProductInterface
+final class ApiProduct extends OrganizationAwareEntity implements ApiProductInterface
{
use DescriptionPropertyAwareTrait;
use DisplayNamePropertyAwareTrait;
diff --git a/src/Api/Monetization/Entity/Balance.php b/src/Api/Monetization/Entity/Balance.php
index 2bc272194..417d1da7d 100644
--- a/src/Api/Monetization/Entity/Balance.php
+++ b/src/Api/Monetization/Entity/Balance.php
@@ -21,7 +21,7 @@
use Apigee\Edge\Api\Monetization\Entity\Property\CurrencyPropertyAwareTrait;
use Apigee\Edge\Api\Monetization\Structure\PaymentTransaction;
-class Balance extends Entity implements BalanceInterface
+final class Balance extends Entity implements BalanceInterface
{
use CurrencyPropertyAwareTrait;
diff --git a/src/Api/Monetization/Entity/Company.php b/src/Api/Monetization/Entity/Company.php
index 1c6b06df4..e2c778dd9 100644
--- a/src/Api/Monetization/Entity/Company.php
+++ b/src/Api/Monetization/Entity/Company.php
@@ -18,6 +18,6 @@
namespace Apigee\Edge\Api\Monetization\Entity;
-class Company extends LegalEntity implements CompanyInterface
+final class Company extends LegalEntity implements CompanyInterface
{
}
diff --git a/src/Api/Monetization/Entity/CompanyAcceptedRatePlan.php b/src/Api/Monetization/Entity/CompanyAcceptedRatePlan.php
index e6d3deed1..6bfe22ef7 100644
--- a/src/Api/Monetization/Entity/CompanyAcceptedRatePlan.php
+++ b/src/Api/Monetization/Entity/CompanyAcceptedRatePlan.php
@@ -23,7 +23,7 @@
/**
* Represents an accepted rate plan by a company.
*/
-class CompanyAcceptedRatePlan extends AcceptedRatePlan implements CompanyAcceptedRatePlanInterface
+final class CompanyAcceptedRatePlan extends AcceptedRatePlan implements CompanyAcceptedRatePlanInterface
{
use CompanyPropertyAwareTrait;
}
diff --git a/src/Api/Monetization/Entity/CompanyRatePlanRevision.php b/src/Api/Monetization/Entity/CompanyRatePlanRevision.php
index 74bd95d48..4d598ac2a 100644
--- a/src/Api/Monetization/Entity/CompanyRatePlanRevision.php
+++ b/src/Api/Monetization/Entity/CompanyRatePlanRevision.php
@@ -21,7 +21,7 @@
use Apigee\Edge\Api\Monetization\Entity\Property\KeepOriginalStartDatePropertyAwareTrait;
use Apigee\Edge\Api\Monetization\Entity\Property\PreviousRatePlanRevisionPropertyAwareTrait;
-class CompanyRatePlanRevision extends CompanyRatePlan implements RatePlanRevisionInterface
+final class CompanyRatePlanRevision extends CompanyRatePlan implements RatePlanRevisionInterface
{
use KeepOriginalStartDatePropertyAwareTrait;
use PreviousRatePlanRevisionPropertyAwareTrait;
diff --git a/src/Api/Monetization/Entity/CompanyReportDefinition.php b/src/Api/Monetization/Entity/CompanyReportDefinition.php
index df4dde554..1ab398ee3 100644
--- a/src/Api/Monetization/Entity/CompanyReportDefinition.php
+++ b/src/Api/Monetization/Entity/CompanyReportDefinition.php
@@ -20,7 +20,7 @@
use Apigee\Edge\Api\Monetization\Entity\Property\CompanyPropertyAwareTrait;
-class CompanyReportDefinition extends ReportDefinition implements CompanyReportDefinitionInterface
+final class CompanyReportDefinition extends ReportDefinition implements CompanyReportDefinitionInterface
{
use CompanyPropertyAwareTrait;
}
diff --git a/src/Api/Monetization/Entity/Developer.php b/src/Api/Monetization/Entity/Developer.php
index 7153835bd..1090bf0ca 100644
--- a/src/Api/Monetization/Entity/Developer.php
+++ b/src/Api/Monetization/Entity/Developer.php
@@ -18,7 +18,7 @@
namespace Apigee\Edge\Api\Monetization\Entity;
-class Developer extends LegalEntity implements DeveloperInterface
+final class Developer extends LegalEntity implements DeveloperInterface
{
/**
* Value of "parent" from the API response.
diff --git a/src/Api/Monetization/Entity/DeveloperAcceptedRatePlan.php b/src/Api/Monetization/Entity/DeveloperAcceptedRatePlan.php
index 80ebc5202..018c641fa 100644
--- a/src/Api/Monetization/Entity/DeveloperAcceptedRatePlan.php
+++ b/src/Api/Monetization/Entity/DeveloperAcceptedRatePlan.php
@@ -23,7 +23,7 @@
/**
* Represents an accepted rate plan by a developer.
*/
-class DeveloperAcceptedRatePlan extends AcceptedRatePlan implements DeveloperAcceptedRatePlanInterface
+final class DeveloperAcceptedRatePlan extends AcceptedRatePlan implements DeveloperAcceptedRatePlanInterface
{
use DeveloperPropertyAwareTrait;
}
diff --git a/src/Api/Monetization/Entity/DeveloperCategory.php b/src/Api/Monetization/Entity/DeveloperCategory.php
index 3cd45fd26..3e2da239c 100644
--- a/src/Api/Monetization/Entity/DeveloperCategory.php
+++ b/src/Api/Monetization/Entity/DeveloperCategory.php
@@ -21,7 +21,7 @@
use Apigee\Edge\Entity\Property\DescriptionPropertyAwareTrait;
use Apigee\Edge\Entity\Property\NamePropertyAwareTrait;
-class DeveloperCategory extends Entity implements DeveloperCategoryInterface
+final class DeveloperCategory extends Entity implements DeveloperCategoryInterface
{
use DescriptionPropertyAwareTrait;
use NamePropertyAwareTrait;
diff --git a/src/Api/Monetization/Entity/DeveloperCategoryRatePlanRevision.php b/src/Api/Monetization/Entity/DeveloperCategoryRatePlanRevision.php
index 7e7906544..dd2fd8aea 100644
--- a/src/Api/Monetization/Entity/DeveloperCategoryRatePlanRevision.php
+++ b/src/Api/Monetization/Entity/DeveloperCategoryRatePlanRevision.php
@@ -21,7 +21,7 @@
use Apigee\Edge\Api\Monetization\Entity\Property\KeepOriginalStartDatePropertyAwareTrait;
use Apigee\Edge\Api\Monetization\Entity\Property\PreviousRatePlanRevisionPropertyAwareTrait;
-class DeveloperCategoryRatePlanRevision extends DeveloperCategoryRatePlan implements RatePlanRevisionInterface
+final class DeveloperCategoryRatePlanRevision extends DeveloperCategoryRatePlan implements RatePlanRevisionInterface
{
use KeepOriginalStartDatePropertyAwareTrait;
use PreviousRatePlanRevisionPropertyAwareTrait;
diff --git a/src/Api/Monetization/Entity/DeveloperRatePlanRevision.php b/src/Api/Monetization/Entity/DeveloperRatePlanRevision.php
index 22f793721..f2ed56620 100644
--- a/src/Api/Monetization/Entity/DeveloperRatePlanRevision.php
+++ b/src/Api/Monetization/Entity/DeveloperRatePlanRevision.php
@@ -21,7 +21,7 @@
use Apigee\Edge\Api\Monetization\Entity\Property\KeepOriginalStartDatePropertyAwareTrait;
use Apigee\Edge\Api\Monetization\Entity\Property\PreviousRatePlanRevisionPropertyAwareTrait;
-class DeveloperRatePlanRevision extends DeveloperRatePlan implements RatePlanRevisionInterface
+final class DeveloperRatePlanRevision extends DeveloperRatePlan implements RatePlanRevisionInterface
{
use KeepOriginalStartDatePropertyAwareTrait;
use PreviousRatePlanRevisionPropertyAwareTrait;
diff --git a/src/Api/Monetization/Entity/DeveloperReportDefinition.php b/src/Api/Monetization/Entity/DeveloperReportDefinition.php
index 031517eb2..51f6862be 100644
--- a/src/Api/Monetization/Entity/DeveloperReportDefinition.php
+++ b/src/Api/Monetization/Entity/DeveloperReportDefinition.php
@@ -20,7 +20,7 @@
use Apigee\Edge\Api\Monetization\Entity\Property\DeveloperPropertyAwareTrait;
-class DeveloperReportDefinition extends ReportDefinition implements DeveloperReportDefinitionInterface
+final class DeveloperReportDefinition extends ReportDefinition implements DeveloperReportDefinitionInterface
{
use DeveloperPropertyAwareTrait;
}
diff --git a/src/Api/Monetization/Entity/DeveloperRole.php b/src/Api/Monetization/Entity/DeveloperRole.php
index 8ae3b4072..294bfb015 100644
--- a/src/Api/Monetization/Entity/DeveloperRole.php
+++ b/src/Api/Monetization/Entity/DeveloperRole.php
@@ -21,7 +21,7 @@
use Apigee\Edge\Entity\Property\DescriptionPropertyAwareTrait;
use Apigee\Edge\Entity\Property\NamePropertyAwareTrait;
-class DeveloperRole extends OrganizationAwareEntity implements DeveloperRoleInterface
+final class DeveloperRole extends OrganizationAwareEntity implements DeveloperRoleInterface
{
use DescriptionPropertyAwareTrait;
use NamePropertyAwareTrait;
diff --git a/src/Api/Monetization/Entity/OrganizationProfile.php b/src/Api/Monetization/Entity/OrganizationProfile.php
index 2b10de63e..ac76f9f8d 100644
--- a/src/Api/Monetization/Entity/OrganizationProfile.php
+++ b/src/Api/Monetization/Entity/OrganizationProfile.php
@@ -26,7 +26,7 @@
use Apigee\Edge\Entity\Property\StatusPropertyAwareTrait;
use DateTimeZone;
-class OrganizationProfile extends Entity implements OrganizationProfileInterface
+final class OrganizationProfile extends Entity implements OrganizationProfileInterface
{
use AddressesPropertyAwareTrait;
use BrokerPropertyAwareTrait;
diff --git a/src/Api/Monetization/Entity/PaymentProvider.php b/src/Api/Monetization/Entity/PaymentProvider.php
index ac8fa8585..e68214e2d 100644
--- a/src/Api/Monetization/Entity/PaymentProvider.php
+++ b/src/Api/Monetization/Entity/PaymentProvider.php
@@ -21,7 +21,7 @@
use Apigee\Edge\Entity\Property\DescriptionPropertyAwareTrait;
use Apigee\Edge\Entity\Property\NamePropertyAwareTrait;
-class PaymentProvider extends Entity implements PaymentProviderInterface
+final class PaymentProvider extends Entity implements PaymentProviderInterface
{
use DescriptionPropertyAwareTrait;
use NamePropertyAwareTrait;
diff --git a/src/Api/Monetization/Entity/PrepaidBalance.php b/src/Api/Monetization/Entity/PrepaidBalance.php
index 44fe41e94..37a04ba53 100644
--- a/src/Api/Monetization/Entity/PrepaidBalance.php
+++ b/src/Api/Monetization/Entity/PrepaidBalance.php
@@ -20,7 +20,7 @@
use Apigee\Edge\Api\Monetization\Entity\Property\CurrencyPropertyAwareTrait;
-class PrepaidBalance extends Entity implements PrepaidBalanceInterface
+final class PrepaidBalance extends Entity implements PrepaidBalanceInterface
{
use CurrencyPropertyAwareTrait;
diff --git a/src/Api/Monetization/Entity/StandardRatePlanRevision.php b/src/Api/Monetization/Entity/StandardRatePlanRevision.php
index 94961ee79..9dcf16b16 100644
--- a/src/Api/Monetization/Entity/StandardRatePlanRevision.php
+++ b/src/Api/Monetization/Entity/StandardRatePlanRevision.php
@@ -21,7 +21,7 @@
use Apigee\Edge\Api\Monetization\Entity\Property\KeepOriginalStartDatePropertyAwareTrait;
use Apigee\Edge\Api\Monetization\Entity\Property\PreviousRatePlanRevisionPropertyAwareTrait;
-class StandardRatePlanRevision extends StandardRatePlan implements RatePlanRevisionInterface
+final class StandardRatePlanRevision extends StandardRatePlan implements RatePlanRevisionInterface
{
use KeepOriginalStartDatePropertyAwareTrait;
use PreviousRatePlanRevisionPropertyAwareTrait;
diff --git a/src/Api/Monetization/Entity/SupportedCurrency.php b/src/Api/Monetization/Entity/SupportedCurrency.php
index 9959821bb..8273e56dc 100644
--- a/src/Api/Monetization/Entity/SupportedCurrency.php
+++ b/src/Api/Monetization/Entity/SupportedCurrency.php
@@ -24,6 +24,9 @@
use Apigee\Edge\Entity\Property\NamePropertyAwareTrait;
use Apigee\Edge\Entity\Property\StatusPropertyAwareTrait;
+/**
+ * @psalm-suppress ClassMustBeFinal
+ */
class SupportedCurrency extends OrganizationAwareEntity implements SupportedCurrencyInterface
{
use DescriptionPropertyAwareTrait;
diff --git a/src/Api/Monetization/Entity/TermsAndConditions.php b/src/Api/Monetization/Entity/TermsAndConditions.php
index f7f1ea4d2..02c73647a 100644
--- a/src/Api/Monetization/Entity/TermsAndConditions.php
+++ b/src/Api/Monetization/Entity/TermsAndConditions.php
@@ -21,7 +21,7 @@
use Apigee\Edge\Api\Monetization\Entity\Property\StartDatePropertyAwareTrait;
use Apigee\Edge\Entity\Property\DescriptionPropertyAwareTrait;
-class TermsAndConditions extends OrganizationAwareEntity implements TermsAndConditionsInterface
+final class TermsAndConditions extends OrganizationAwareEntity implements TermsAndConditionsInterface
{
use DescriptionPropertyAwareTrait;
use StartDatePropertyAwareTrait;
diff --git a/src/Api/Monetization/NameConverter/AddressNameConverter.php b/src/Api/Monetization/NameConverter/AddressNameConverter.php
index 6b1a7b135..a075ba3a5 100644
--- a/src/Api/Monetization/NameConverter/AddressNameConverter.php
+++ b/src/Api/Monetization/NameConverter/AddressNameConverter.php
@@ -20,7 +20,7 @@
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class AddressNameConverter extends NameConverterBase implements NameConverterInterface
+final class AddressNameConverter extends NameConverterBase implements NameConverterInterface
{
/**
* {@inheritdoc}
diff --git a/src/Api/Monetization/NameConverter/ApiPackageNameConverter.php b/src/Api/Monetization/NameConverter/ApiPackageNameConverter.php
index da5484477..2bb23ad27 100644
--- a/src/Api/Monetization/NameConverter/ApiPackageNameConverter.php
+++ b/src/Api/Monetization/NameConverter/ApiPackageNameConverter.php
@@ -29,7 +29,7 @@
*
* @see \Apigee\Edge\Api\Monetization\Entity\ApiPackage
*/
-class ApiPackageNameConverter extends NameConverterBase implements NameConverterInterface
+final class ApiPackageNameConverter extends NameConverterBase implements NameConverterInterface
{
/**
* {@inheritdoc}
diff --git a/src/Api/Monetization/NameConverter/BalanceNameConverter.php b/src/Api/Monetization/NameConverter/BalanceNameConverter.php
index 4b8f4b57d..70bd4fb28 100644
--- a/src/Api/Monetization/NameConverter/BalanceNameConverter.php
+++ b/src/Api/Monetization/NameConverter/BalanceNameConverter.php
@@ -20,7 +20,7 @@
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class BalanceNameConverter extends NameConverterBase implements NameConverterInterface
+final class BalanceNameConverter extends NameConverterBase implements NameConverterInterface
{
/**
* {@inheritdoc}
diff --git a/src/Api/Monetization/NameConverter/CompanyAcceptedRatePlanNameConverter.php b/src/Api/Monetization/NameConverter/CompanyAcceptedRatePlanNameConverter.php
index 9e08b3a9e..4bca0a4a4 100644
--- a/src/Api/Monetization/NameConverter/CompanyAcceptedRatePlanNameConverter.php
+++ b/src/Api/Monetization/NameConverter/CompanyAcceptedRatePlanNameConverter.php
@@ -27,7 +27,7 @@
*
* @see \Apigee\Edge\Api\Monetization\Entity\CompanyAcceptedRatePlan
*/
-class CompanyAcceptedRatePlanNameConverter extends NameConverterBase implements NameConverterInterface
+final class CompanyAcceptedRatePlanNameConverter extends NameConverterBase implements NameConverterInterface
{
/**
* {@inheritdoc}
diff --git a/src/Api/Monetization/NameConverter/CompanyPaymentTransactionNameConverter.php b/src/Api/Monetization/NameConverter/CompanyPaymentTransactionNameConverter.php
index 9072b43c1..305854ae9 100644
--- a/src/Api/Monetization/NameConverter/CompanyPaymentTransactionNameConverter.php
+++ b/src/Api/Monetization/NameConverter/CompanyPaymentTransactionNameConverter.php
@@ -18,7 +18,7 @@
namespace Apigee\Edge\Api\Monetization\NameConverter;
-class CompanyPaymentTransactionNameConverter extends PaymentTransactionNameConverter
+final class CompanyPaymentTransactionNameConverter extends PaymentTransactionNameConverter
{
/**
* {@inheritdoc}
diff --git a/src/Api/Monetization/NameConverter/CompanyRatePlanNameConverter.php b/src/Api/Monetization/NameConverter/CompanyRatePlanNameConverter.php
index 21a203fea..40c86532b 100644
--- a/src/Api/Monetization/NameConverter/CompanyRatePlanNameConverter.php
+++ b/src/Api/Monetization/NameConverter/CompanyRatePlanNameConverter.php
@@ -20,7 +20,7 @@
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class CompanyRatePlanNameConverter extends RatePlanNameConverter implements NameConverterInterface
+final class CompanyRatePlanNameConverter extends RatePlanNameConverter implements NameConverterInterface
{
/**
* {@inheritdoc}
diff --git a/src/Api/Monetization/NameConverter/CompanyReportDefinitionNameConverter.php b/src/Api/Monetization/NameConverter/CompanyReportDefinitionNameConverter.php
index 88c9a7786..e9c8d0243 100644
--- a/src/Api/Monetization/NameConverter/CompanyReportDefinitionNameConverter.php
+++ b/src/Api/Monetization/NameConverter/CompanyReportDefinitionNameConverter.php
@@ -24,7 +24,7 @@
*
* @see \Apigee\Edge\Api\Monetization\Entity\CompanyReportDefinition
*/
-class CompanyReportDefinitionNameConverter extends ReportDefinitionNameConverter
+final class CompanyReportDefinitionNameConverter extends ReportDefinitionNameConverter
{
/**
* {@inheritdoc}
diff --git a/src/Api/Monetization/NameConverter/LegalEntityNameConvert.php b/src/Api/Monetization/NameConverter/LegalEntityNameConvert.php
index 274574e21..4e079dd21 100644
--- a/src/Api/Monetization/NameConverter/LegalEntityNameConvert.php
+++ b/src/Api/Monetization/NameConverter/LegalEntityNameConvert.php
@@ -26,7 +26,7 @@
*
* @see \Apigee\Edge\Api\Monetization\Entity\LegalEntity
*/
-class LegalEntityNameConvert extends NameConverterBase implements NameConverterInterface
+final class LegalEntityNameConvert extends NameConverterBase implements NameConverterInterface
{
/**
* {@inheritdoc}
diff --git a/src/Api/Monetization/NameConverter/OrganizationProfileNameConverter.php b/src/Api/Monetization/NameConverter/OrganizationProfileNameConverter.php
index cc0e4fd6c..77820d91e 100755
--- a/src/Api/Monetization/NameConverter/OrganizationProfileNameConverter.php
+++ b/src/Api/Monetization/NameConverter/OrganizationProfileNameConverter.php
@@ -20,7 +20,7 @@
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class OrganizationProfileNameConverter extends NameConverterBase implements NameConverterInterface
+final class OrganizationProfileNameConverter extends NameConverterBase implements NameConverterInterface
{
/**
* {@inheritdoc}
diff --git a/src/Api/Monetization/NameConverter/PrepaidBalanceNameConverter.php b/src/Api/Monetization/NameConverter/PrepaidBalanceNameConverter.php
index 3bcf93a41..d214c7f30 100644
--- a/src/Api/Monetization/NameConverter/PrepaidBalanceNameConverter.php
+++ b/src/Api/Monetization/NameConverter/PrepaidBalanceNameConverter.php
@@ -20,7 +20,7 @@
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class PrepaidBalanceNameConverter extends NameConverterBase implements NameConverterInterface
+final class PrepaidBalanceNameConverter extends NameConverterBase implements NameConverterInterface
{
/**
* {@inheritdoc}
diff --git a/src/Api/Monetization/NameConverter/ReportCriteriaNameConverter.php b/src/Api/Monetization/NameConverter/ReportCriteriaNameConverter.php
index 0c5ee7cde..bb66dee55 100644
--- a/src/Api/Monetization/NameConverter/ReportCriteriaNameConverter.php
+++ b/src/Api/Monetization/NameConverter/ReportCriteriaNameConverter.php
@@ -18,7 +18,7 @@
namespace Apigee\Edge\Api\Monetization\NameConverter;
-class ReportCriteriaNameConverter extends NameConverterBase
+final class ReportCriteriaNameConverter extends NameConverterBase
{
/**
* {@inheritdoc}
diff --git a/src/Api/Monetization/NameConverter/SupportedCurrencyNameConverter.php b/src/Api/Monetization/NameConverter/SupportedCurrencyNameConverter.php
index f13daaf36..ec440b7d0 100644
--- a/src/Api/Monetization/NameConverter/SupportedCurrencyNameConverter.php
+++ b/src/Api/Monetization/NameConverter/SupportedCurrencyNameConverter.php
@@ -20,7 +20,7 @@
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class SupportedCurrencyNameConverter extends NameConverterBase implements NameConverterInterface
+final class SupportedCurrencyNameConverter extends NameConverterBase implements NameConverterInterface
{
/**
* {@inheritdoc}
diff --git a/src/Api/Monetization/NameConverter/TermsAndConditionsNameConverter.php b/src/Api/Monetization/NameConverter/TermsAndConditionsNameConverter.php
index 1bf68531b..39339e521 100644
--- a/src/Api/Monetization/NameConverter/TermsAndConditionsNameConverter.php
+++ b/src/Api/Monetization/NameConverter/TermsAndConditionsNameConverter.php
@@ -20,7 +20,7 @@
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class TermsAndConditionsNameConverter extends NameConverterBase implements NameConverterInterface
+final class TermsAndConditionsNameConverter extends NameConverterBase implements NameConverterInterface
{
/**
* {@inheritdoc}
diff --git a/src/Api/Monetization/Normalizer/AcceptedRatePlanNormalizer.php b/src/Api/Monetization/Normalizer/AcceptedRatePlanNormalizer.php
index 6267b12b3..5b9efe964 100644
--- a/src/Api/Monetization/Normalizer/AcceptedRatePlanNormalizer.php
+++ b/src/Api/Monetization/Normalizer/AcceptedRatePlanNormalizer.php
@@ -20,6 +20,7 @@
use Apigee\Edge\Api\Monetization\Entity\AcceptedRatePlanInterface;
use Apigee\Edge\Api\Monetization\Utility\TimezoneFixerHelperTrait;
+use ArrayObject;
class AcceptedRatePlanNormalizer extends EntityNormalizer
{
@@ -31,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($data, $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 $data */
/** @var object $normalized */
diff --git a/src/Api/Monetization/Normalizer/AddressNormalizer.php b/src/Api/Monetization/Normalizer/AddressNormalizer.php
index d72aa2cbe..4e9bd8100 100644
--- a/src/Api/Monetization/Normalizer/AddressNormalizer.php
+++ b/src/Api/Monetization/Normalizer/AddressNormalizer.php
@@ -26,7 +26,7 @@
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class AddressNormalizer extends ObjectNormalizer
+final class AddressNormalizer extends ObjectNormalizer
{
/**
* AddressNormalizer constructor.
diff --git a/src/Api/Monetization/Normalizer/ApiPackageNormalizer.php b/src/Api/Monetization/Normalizer/ApiPackageNormalizer.php
index 2f52fc21d..c8609ee49 100644
--- a/src/Api/Monetization/Normalizer/ApiPackageNormalizer.php
+++ b/src/Api/Monetization/Normalizer/ApiPackageNormalizer.php
@@ -20,12 +20,13 @@
use Apigee\Edge\Api\Monetization\Entity\ApiPackageInterface;
use Apigee\Edge\Api\Monetization\NameConverter\ApiPackageNameConverter;
+use ArrayObject;
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface;
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class ApiPackageNormalizer extends EntityNormalizer
+final class ApiPackageNormalizer extends EntityNormalizer
{
/**
* ApiPackageNormalizer constructor.
@@ -47,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($data, $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 = (array) parent::normalize($data, $format, $context);
diff --git a/src/Api/Monetization/Normalizer/BalanceNormalizer.php b/src/Api/Monetization/Normalizer/BalanceNormalizer.php
index 58b91b9fe..88c9778b8 100644
--- a/src/Api/Monetization/Normalizer/BalanceNormalizer.php
+++ b/src/Api/Monetization/Normalizer/BalanceNormalizer.php
@@ -25,7 +25,7 @@
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class BalanceNormalizer extends EntityNormalizer
+final class BalanceNormalizer extends EntityNormalizer
{
/**
* BalanceNormalizer constructor.
diff --git a/src/Api/Monetization/Normalizer/CompanyAcceptedRatePlanNormalizer.php b/src/Api/Monetization/Normalizer/CompanyAcceptedRatePlanNormalizer.php
index 81a5044a7..a45269e37 100644
--- a/src/Api/Monetization/Normalizer/CompanyAcceptedRatePlanNormalizer.php
+++ b/src/Api/Monetization/Normalizer/CompanyAcceptedRatePlanNormalizer.php
@@ -25,7 +25,7 @@
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class CompanyAcceptedRatePlanNormalizer extends AcceptedRatePlanNormalizer
+final class CompanyAcceptedRatePlanNormalizer extends AcceptedRatePlanNormalizer
{
/**
* CompanyAcceptedRatePlanNormalizer constructor.
diff --git a/src/Api/Monetization/Normalizer/CompanyPaymentTransactionNormalizer.php b/src/Api/Monetization/Normalizer/CompanyPaymentTransactionNormalizer.php
index aa4c49c9d..19509656d 100644
--- a/src/Api/Monetization/Normalizer/CompanyPaymentTransactionNormalizer.php
+++ b/src/Api/Monetization/Normalizer/CompanyPaymentTransactionNormalizer.php
@@ -20,12 +20,13 @@
use Apigee\Edge\Api\Monetization\NameConverter\CompanyRatePlanNameConverter;
use Apigee\Edge\Api\Monetization\Structure\CompanyPaymentTransaction;
+use ArrayObject;
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface;
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class CompanyPaymentTransactionNormalizer extends PaymentTransactionNormalizer
+final class CompanyPaymentTransactionNormalizer extends PaymentTransactionNormalizer
{
/**
* CompanyPaymentTransactionNormalizer constructor.
@@ -47,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($data, $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($data, $format, $context);
diff --git a/src/Api/Monetization/Normalizer/CompanyRatePlanNormalizer.php b/src/Api/Monetization/Normalizer/CompanyRatePlanNormalizer.php
index 84cf04c4e..341ed83d1 100644
--- a/src/Api/Monetization/Normalizer/CompanyRatePlanNormalizer.php
+++ b/src/Api/Monetization/Normalizer/CompanyRatePlanNormalizer.php
@@ -25,7 +25,7 @@
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class CompanyRatePlanNormalizer extends LegalEntityRatePlanNormalizer
+final class CompanyRatePlanNormalizer extends LegalEntityRatePlanNormalizer
{
/**
* CompanyRatePlanNormalizer constructor.
diff --git a/src/Api/Monetization/Normalizer/CompanyReportDefinitionNormalizer.php b/src/Api/Monetization/Normalizer/CompanyReportDefinitionNormalizer.php
index 172fb5dc6..908b103fd 100644
--- a/src/Api/Monetization/Normalizer/CompanyReportDefinitionNormalizer.php
+++ b/src/Api/Monetization/Normalizer/CompanyReportDefinitionNormalizer.php
@@ -25,7 +25,7 @@
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class CompanyReportDefinitionNormalizer extends LegalEntityReportDefinitionNormalizer
+final class CompanyReportDefinitionNormalizer extends LegalEntityReportDefinitionNormalizer
{
/**
* CompanyReportDefinitionNormalizer constructor.
diff --git a/src/Api/Monetization/Normalizer/DateTimeZoneNormalizer.php b/src/Api/Monetization/Normalizer/DateTimeZoneNormalizer.php
index 20ecce818..e573c8f28 100644
--- a/src/Api/Monetization/Normalizer/DateTimeZoneNormalizer.php
+++ b/src/Api/Monetization/Normalizer/DateTimeZoneNormalizer.php
@@ -18,15 +18,16 @@
namespace Apigee\Edge\Api\Monetization\Normalizer;
+use ArrayObject;
use DateTimeZone;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
-class DateTimeZoneNormalizer implements NormalizerInterface
+final class DateTimeZoneNormalizer implements NormalizerInterface
{
/**
* {@inheritdoc}
*/
- public function normalize($data, $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
{
return $data->getName();
}
diff --git a/src/Api/Monetization/Normalizer/DeveloperCategoryRatePlanNormalizer.php b/src/Api/Monetization/Normalizer/DeveloperCategoryRatePlanNormalizer.php
index cff66428d..4f8450cdd 100644
--- a/src/Api/Monetization/Normalizer/DeveloperCategoryRatePlanNormalizer.php
+++ b/src/Api/Monetization/Normalizer/DeveloperCategoryRatePlanNormalizer.php
@@ -20,8 +20,9 @@
use Apigee\Edge\Api\Monetization\Entity\DeveloperCategoryRatePlanInterface;
use Apigee\Edge\Api\Monetization\Entity\RatePlanInterface;
+use ArrayObject;
-class DeveloperCategoryRatePlanNormalizer extends RatePlanNormalizer
+final class DeveloperCategoryRatePlanNormalizer extends RatePlanNormalizer
{
/**
* {@inheritdoc}
@@ -29,7 +30,7 @@ class DeveloperCategoryRatePlanNormalizer extends RatePlanNormalizer
* @psalm-suppress InvalidReturnType Returning an object here is required
* for creating a valid Apigee Edge request.
*/
- public function normalize($data, $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($data, $format, $context);
diff --git a/src/Api/Monetization/Normalizer/DeveloperPaymentTransactionNormalizer.php b/src/Api/Monetization/Normalizer/DeveloperPaymentTransactionNormalizer.php
index f5f5c48e9..6a9dfa9d5 100644
--- a/src/Api/Monetization/Normalizer/DeveloperPaymentTransactionNormalizer.php
+++ b/src/Api/Monetization/Normalizer/DeveloperPaymentTransactionNormalizer.php
@@ -19,8 +19,9 @@
namespace Apigee\Edge\Api\Monetization\Normalizer;
use Apigee\Edge\Api\Monetization\Structure\DeveloperPaymentTransaction;
+use ArrayObject;
-class DeveloperPaymentTransactionNormalizer extends PaymentTransactionNormalizer
+final class DeveloperPaymentTransactionNormalizer extends PaymentTransactionNormalizer
{
/**
* {@inheritdoc}
@@ -28,7 +29,7 @@ class DeveloperPaymentTransactionNormalizer extends PaymentTransactionNormalizer
* @psalm-suppress InvalidReturnType Returning an object here is required
* for creating a valid Apigee Edge request.
*/
- public function normalize($data, $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($data, $format, $context);
diff --git a/src/Api/Monetization/Normalizer/DeveloperRatePlanNormalizer.php b/src/Api/Monetization/Normalizer/DeveloperRatePlanNormalizer.php
index 49b9fa1d4..d15377699 100644
--- a/src/Api/Monetization/Normalizer/DeveloperRatePlanNormalizer.php
+++ b/src/Api/Monetization/Normalizer/DeveloperRatePlanNormalizer.php
@@ -20,7 +20,7 @@
use Apigee\Edge\Api\Monetization\Entity\DeveloperRatePlanInterface;
-class DeveloperRatePlanNormalizer extends LegalEntityRatePlanNormalizer
+final class DeveloperRatePlanNormalizer extends LegalEntityRatePlanNormalizer
{
/**
* {@inheritdoc}
diff --git a/src/Api/Monetization/Normalizer/DeveloperReportDefinitionNormalizer.php b/src/Api/Monetization/Normalizer/DeveloperReportDefinitionNormalizer.php
index 6b12fb437..8649ddeb5 100644
--- a/src/Api/Monetization/Normalizer/DeveloperReportDefinitionNormalizer.php
+++ b/src/Api/Monetization/Normalizer/DeveloperReportDefinitionNormalizer.php
@@ -20,7 +20,7 @@
use Apigee\Edge\Api\Monetization\Entity\DeveloperReportDefinitionInterface;
-class DeveloperReportDefinitionNormalizer extends LegalEntityReportDefinitionNormalizer
+final class DeveloperReportDefinitionNormalizer extends LegalEntityReportDefinitionNormalizer
{
/**
* {@inheritdoc}
diff --git a/src/Api/Monetization/Normalizer/EntityNormalizer.php b/src/Api/Monetization/Normalizer/EntityNormalizer.php
index 7ce1480af..eb2534b47 100644
--- a/src/Api/Monetization/Normalizer/EntityNormalizer.php
+++ b/src/Api/Monetization/Normalizer/EntityNormalizer.php
@@ -20,6 +20,7 @@
use Apigee\Edge\Api\Monetization\Structure\NestedObjectReferenceInterface;
use Apigee\Edge\Normalizer\ObjectNormalizer;
+use ArrayObject;
use ReflectionObject;
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface;
@@ -63,7 +64,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory
* @psalm-suppress InvalidReturnType stdClass is also an object.
* @psalm-suppress InvalidPropertyFetch.
*/
- public function normalize($data, $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 = (array) parent::normalize($data, $format, $context);
@@ -127,7 +128,6 @@ protected function getNestedObjectProperties($object): array
$entityReferenceProperties = [];
$ro = new ReflectionObject($object);
foreach ($ro->getProperties() as $property) {
- $property->setAccessible(true);
$value = $property->getValue($object);
if (is_object($value) && $value instanceof NestedObjectReferenceInterface) {
if ($this->nameConverter) {
diff --git a/src/Api/Monetization/Normalizer/LegalEntityNormalizer.php b/src/Api/Monetization/Normalizer/LegalEntityNormalizer.php
index b7a075376..c1975539c 100644
--- a/src/Api/Monetization/Normalizer/LegalEntityNormalizer.php
+++ b/src/Api/Monetization/Normalizer/LegalEntityNormalizer.php
@@ -22,12 +22,13 @@
use Apigee\Edge\Api\Monetization\Entity\DeveloperInterface;
use Apigee\Edge\Api\Monetization\Entity\LegalEntityInterface;
use Apigee\Edge\Api\Monetization\NameConverter\LegalEntityNameConvert;
+use ArrayObject;
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface;
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class LegalEntityNormalizer extends EntityNormalizer
+final class LegalEntityNormalizer extends EntityNormalizer
{
/**
* LegalEntityNormalizer constructor.
@@ -49,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($data, $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($data, $format, $context);
diff --git a/src/Api/Monetization/Normalizer/LegalEntityRatePlanNormalizer.php b/src/Api/Monetization/Normalizer/LegalEntityRatePlanNormalizer.php
index edd52da28..c588c485f 100644
--- a/src/Api/Monetization/Normalizer/LegalEntityRatePlanNormalizer.php
+++ b/src/Api/Monetization/Normalizer/LegalEntityRatePlanNormalizer.php
@@ -19,6 +19,7 @@
namespace Apigee\Edge\Api\Monetization\Normalizer;
use Apigee\Edge\Api\Monetization\Entity\RatePlanInterface;
+use ArrayObject;
abstract class LegalEntityRatePlanNormalizer extends RatePlanNormalizer
{
@@ -28,7 +29,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($data, $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($data, $format, $context);
diff --git a/src/Api/Monetization/Normalizer/LegalEntityReportDefinitionNormalizer.php b/src/Api/Monetization/Normalizer/LegalEntityReportDefinitionNormalizer.php
index 34e9a6616..5fbd9bb64 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;
+use ArrayObject;
abstract class LegalEntityReportDefinitionNormalizer extends ReportDefinitionNormalizer
{
@@ -27,7 +28,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($data, $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($data, $format, $context);
diff --git a/src/Api/Monetization/Normalizer/OrganizationProfileNormalizer.php b/src/Api/Monetization/Normalizer/OrganizationProfileNormalizer.php
index e836fe331..992de08af 100644
--- a/src/Api/Monetization/Normalizer/OrganizationProfileNormalizer.php
+++ b/src/Api/Monetization/Normalizer/OrganizationProfileNormalizer.php
@@ -25,7 +25,7 @@
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class OrganizationProfileNormalizer extends EntityNormalizer
+final class OrganizationProfileNormalizer extends EntityNormalizer
{
/**
* OrganizationProfileNormalizer constructor.
diff --git a/src/Api/Monetization/Normalizer/PrepaidBalanceNormalizer.php b/src/Api/Monetization/Normalizer/PrepaidBalanceNormalizer.php
index ca951e84e..3c3b78f12 100644
--- a/src/Api/Monetization/Normalizer/PrepaidBalanceNormalizer.php
+++ b/src/Api/Monetization/Normalizer/PrepaidBalanceNormalizer.php
@@ -25,7 +25,7 @@
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class PrepaidBalanceNormalizer extends EntityNormalizer
+final class PrepaidBalanceNormalizer extends EntityNormalizer
{
/**
* PrepaidBalanceNormalizer constructor.
diff --git a/src/Api/Monetization/Normalizer/RatePlanNormalizer.php b/src/Api/Monetization/Normalizer/RatePlanNormalizer.php
index 0d1cf5755..716a91f0d 100644
--- a/src/Api/Monetization/Normalizer/RatePlanNormalizer.php
+++ b/src/Api/Monetization/Normalizer/RatePlanNormalizer.php
@@ -22,6 +22,7 @@
use Apigee\Edge\Api\Monetization\NameConverter\RatePlanNameConverter;
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;
@@ -51,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($data, $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($data, $format, $context);
diff --git a/src/Api/Monetization/Normalizer/RatePlanNormalizerFactory.php b/src/Api/Monetization/Normalizer/RatePlanNormalizerFactory.php
index de824cbaa..dc14155f1 100644
--- a/src/Api/Monetization/Normalizer/RatePlanNormalizerFactory.php
+++ b/src/Api/Monetization/Normalizer/RatePlanNormalizerFactory.php
@@ -18,12 +18,13 @@
namespace Apigee\Edge\Api\Monetization\Normalizer;
+use ArrayObject;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
use Symfony\Component\Serializer\SerializerAwareInterface;
use Symfony\Component\Serializer\SerializerAwareTrait;
use Symfony\Component\Serializer\SerializerInterface;
-class RatePlanNormalizerFactory implements NormalizerInterface, SerializerAwareInterface
+final class RatePlanNormalizerFactory implements NormalizerInterface, SerializerAwareInterface
{
use SerializerAwareTrait {
setSerializer as private traitSetSerializer;
@@ -53,7 +54,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($data, $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
diff --git a/src/Api/Monetization/Normalizer/RatePlanRateNormalizer.php b/src/Api/Monetization/Normalizer/RatePlanRateNormalizer.php
index 0b98473ac..54a70d4b1 100644
--- a/src/Api/Monetization/Normalizer/RatePlanRateNormalizer.php
+++ b/src/Api/Monetization/Normalizer/RatePlanRateNormalizer.php
@@ -21,8 +21,9 @@
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
+final class RatePlanRateNormalizer extends ObjectNormalizer
{
/**
* {@inheritdoc}
@@ -30,7 +31,7 @@ class RatePlanRateNormalizer extends ObjectNormalizer
* @psalm-suppress InvalidReturnType Returning an object here is required
* for creating a valid Apigee Edge request.
*/
- public function normalize($data, $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($data, $format, $context);
diff --git a/src/Api/Monetization/Normalizer/ReportCriteriaNormalizer.php b/src/Api/Monetization/Normalizer/ReportCriteriaNormalizer.php
index c8278ac17..8e807dedd 100644
--- a/src/Api/Monetization/Normalizer/ReportCriteriaNormalizer.php
+++ b/src/Api/Monetization/Normalizer/ReportCriteriaNormalizer.php
@@ -22,13 +22,14 @@
use Apigee\Edge\Api\Monetization\Structure\Reports\Criteria\AbstractCriteria;
use Apigee\Edge\Api\Monetization\Utility\TimezoneFixerHelperTrait;
use Apigee\Edge\Normalizer\ObjectNormalizer;
+use ArrayObject;
use DateTimeZone;
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface;
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class ReportCriteriaNormalizer extends ObjectNormalizer
+final class ReportCriteriaNormalizer extends ObjectNormalizer
{
use TimezoneFixerHelperTrait;
@@ -59,7 +60,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($data, $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($data, $format, $context);
diff --git a/src/Api/Monetization/Normalizer/ReportDefinitionNormalizer.php b/src/Api/Monetization/Normalizer/ReportDefinitionNormalizer.php
index 3b1acb3e1..6d8601e27 100644
--- a/src/Api/Monetization/Normalizer/ReportDefinitionNormalizer.php
+++ b/src/Api/Monetization/Normalizer/ReportDefinitionNormalizer.php
@@ -21,6 +21,7 @@
use Apigee\Edge\Api\Monetization\Entity\ReportDefinitionInterface;
use Apigee\Edge\Api\Monetization\NameConverter\ReportDefinitionNameConverter;
use Apigee\Edge\Api\Monetization\Utility\ReportTypeFromCriteriaHelperTrait;
+use ArrayObject;
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface;
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
@@ -50,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($data, $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 ReportDefinitionInterface $data */
/** @var object $normalized */
diff --git a/src/Api/Monetization/Normalizer/StandardRatePlanNormalizer.php b/src/Api/Monetization/Normalizer/StandardRatePlanNormalizer.php
index a0d4a4353..b58c2477c 100644
--- a/src/Api/Monetization/Normalizer/StandardRatePlanNormalizer.php
+++ b/src/Api/Monetization/Normalizer/StandardRatePlanNormalizer.php
@@ -20,8 +20,9 @@
use Apigee\Edge\Api\Monetization\Entity\RatePlanInterface;
use Apigee\Edge\Api\Monetization\Entity\StandardRatePlanInterface;
+use ArrayObject;
-class StandardRatePlanNormalizer extends RatePlanNormalizer
+final class StandardRatePlanNormalizer extends RatePlanNormalizer
{
/**
* {@inheritdoc}
@@ -29,7 +30,7 @@ class StandardRatePlanNormalizer extends RatePlanNormalizer
* @psalm-suppress InvalidReturnType Returning an object here is required
* for creating a valid Apigee Edge request.
*/
- public function normalize($data, $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($data, $format, $context);
diff --git a/src/Api/Monetization/Normalizer/SupportedCurrencyNormalizer.php b/src/Api/Monetization/Normalizer/SupportedCurrencyNormalizer.php
index f4de7b0fc..4d4d0277e 100644
--- a/src/Api/Monetization/Normalizer/SupportedCurrencyNormalizer.php
+++ b/src/Api/Monetization/Normalizer/SupportedCurrencyNormalizer.php
@@ -25,7 +25,7 @@
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class SupportedCurrencyNormalizer extends EntityNormalizer
+final class SupportedCurrencyNormalizer extends EntityNormalizer
{
/**
* SupportedCurrencyNormalizer constructor.
diff --git a/src/Api/Monetization/Normalizer/TermsAndConditionsNormalizer.php b/src/Api/Monetization/Normalizer/TermsAndConditionsNormalizer.php
index 7c28dbc92..1bfbcb8ff 100644
--- a/src/Api/Monetization/Normalizer/TermsAndConditionsNormalizer.php
+++ b/src/Api/Monetization/Normalizer/TermsAndConditionsNormalizer.php
@@ -22,12 +22,13 @@
use Apigee\Edge\Api\Monetization\NameConverter\TermsAndConditionsNameConverter;
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;
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
-class TermsAndConditionsNormalizer extends EntityNormalizer
+final class TermsAndConditionsNormalizer extends EntityNormalizer
{
use TimezoneFixerHelperTrait;
@@ -51,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($data, $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($data, $format, $context);
diff --git a/src/Api/Monetization/Serializer/AcceptedRatePlanSerializer.php b/src/Api/Monetization/Serializer/AcceptedRatePlanSerializer.php
index 2afe0ea86..967eaaeca 100644
--- a/src/Api/Monetization/Serializer/AcceptedRatePlanSerializer.php
+++ b/src/Api/Monetization/Serializer/AcceptedRatePlanSerializer.php
@@ -23,7 +23,7 @@
use Apigee\Edge\Api\Monetization\Normalizer\AcceptedRatePlanNormalizer;
use Apigee\Edge\Api\Monetization\Normalizer\CompanyAcceptedRatePlanNormalizer;
-class AcceptedRatePlanSerializer extends EntitySerializer
+final class AcceptedRatePlanSerializer extends EntitySerializer
{
/**
* {@inheritdoc}
diff --git a/src/Api/Monetization/Serializer/AddressSerializer.php b/src/Api/Monetization/Serializer/AddressSerializer.php
index c2feb6e98..4772aad8f 100644
--- a/src/Api/Monetization/Serializer/AddressSerializer.php
+++ b/src/Api/Monetization/Serializer/AddressSerializer.php
@@ -21,7 +21,7 @@
use Apigee\Edge\Api\Monetization\Denormalizer\AddressDenormalizer;
use Apigee\Edge\Api\Monetization\Normalizer\AddressNormalizer;
-class AddressSerializer extends EntitySerializer
+final class AddressSerializer extends EntitySerializer
{
/**
* {@inheritdoc}
diff --git a/src/Api/Monetization/Serializer/ApiPackageSerializer.php b/src/Api/Monetization/Serializer/ApiPackageSerializer.php
index 702c31658..0ea6e175f 100644
--- a/src/Api/Monetization/Serializer/ApiPackageSerializer.php
+++ b/src/Api/Monetization/Serializer/ApiPackageSerializer.php
@@ -21,7 +21,7 @@
use Apigee\Edge\Api\Monetization\Denormalizer\ApiPackageDenormalizer;
use Apigee\Edge\Api\Monetization\Normalizer\ApiPackageNormalizer;
-class ApiPackageSerializer extends EntitySerializer
+final class ApiPackageSerializer extends EntitySerializer
{
/**
* {@inheritdoc}
diff --git a/src/Api/Monetization/Serializer/BalanceSerializer.php b/src/Api/Monetization/Serializer/BalanceSerializer.php
index 8dfa255c0..da562c8b7 100644
--- a/src/Api/Monetization/Serializer/BalanceSerializer.php
+++ b/src/Api/Monetization/Serializer/BalanceSerializer.php
@@ -21,7 +21,7 @@
use Apigee\Edge\Api\Monetization\Denormalizer\BalanceDenormalizer;
use Apigee\Edge\Api\Monetization\Normalizer\BalanceNormalizer;
-class BalanceSerializer extends EntitySerializer
+final class BalanceSerializer extends EntitySerializer
{
/**
* {@inheritdoc}
diff --git a/src/Api/Monetization/Serializer/LegalEntitySerializer.php b/src/Api/Monetization/Serializer/LegalEntitySerializer.php
index 553cde1c4..6a97c940a 100644
--- a/src/Api/Monetization/Serializer/LegalEntitySerializer.php
+++ b/src/Api/Monetization/Serializer/LegalEntitySerializer.php
@@ -23,7 +23,7 @@
use Apigee\Edge\Denormalizer\AttributesPropertyDenormalizer;
use Apigee\Edge\Normalizer\KeyValueMapNormalizer;
-class LegalEntitySerializer extends EntitySerializer
+final class LegalEntitySerializer extends EntitySerializer
{
/**
* {@inheritdoc}
diff --git a/src/Api/Monetization/Serializer/LegalEntityTermsAndConditionsSerializer.php b/src/Api/Monetization/Serializer/LegalEntityTermsAndConditionsSerializer.php
index 5c65cccd6..cc4c3549e 100644
--- a/src/Api/Monetization/Serializer/LegalEntityTermsAndConditionsSerializer.php
+++ b/src/Api/Monetization/Serializer/LegalEntityTermsAndConditionsSerializer.php
@@ -21,7 +21,7 @@
use Apigee\Edge\Api\Monetization\Denormalizer\TermsAndConditionsDenormalizer;
use Apigee\Edge\Api\Monetization\Normalizer\TermsAndConditionsNormalizer;
-class LegalEntityTermsAndConditionsSerializer extends EntitySerializer
+final class LegalEntityTermsAndConditionsSerializer extends EntitySerializer
{
/**
* {@inheritdoc}
diff --git a/src/Api/Monetization/Serializer/OrganizationProfileSerializer.php b/src/Api/Monetization/Serializer/OrganizationProfileSerializer.php
index 395dd1692..537076a14 100644
--- a/src/Api/Monetization/Serializer/OrganizationProfileSerializer.php
+++ b/src/Api/Monetization/Serializer/OrganizationProfileSerializer.php
@@ -21,7 +21,7 @@
use Apigee\Edge\Api\Monetization\Denormalizer\OrganizationProfileDenormalizer;
use Apigee\Edge\Api\Monetization\Normalizer\OrganizationProfileNormalizer;
-class OrganizationProfileSerializer extends EntitySerializer
+final class OrganizationProfileSerializer extends EntitySerializer
{
/**
* {@inheritdoc}
diff --git a/src/Api/Monetization/Serializer/PaymentTransactionSerializer.php b/src/Api/Monetization/Serializer/PaymentTransactionSerializer.php
index 9dd78243d..a1c7475bb 100644
--- a/src/Api/Monetization/Serializer/PaymentTransactionSerializer.php
+++ b/src/Api/Monetization/Serializer/PaymentTransactionSerializer.php
@@ -23,7 +23,7 @@
use Apigee\Edge\Api\Monetization\Normalizer\CompanyPaymentTransactionNormalizer;
use Apigee\Edge\Api\Monetization\Normalizer\DeveloperPaymentTransactionNormalizer;
-class PaymentTransactionSerializer extends EntitySerializer
+final class PaymentTransactionSerializer extends EntitySerializer
{
/**
* {@inheritdoc}
diff --git a/src/Api/Monetization/Serializer/PrepaidBalanceSerializer.php b/src/Api/Monetization/Serializer/PrepaidBalanceSerializer.php
index 0e6408aa3..847022e02 100644
--- a/src/Api/Monetization/Serializer/PrepaidBalanceSerializer.php
+++ b/src/Api/Monetization/Serializer/PrepaidBalanceSerializer.php
@@ -21,7 +21,7 @@
use Apigee\Edge\Api\Monetization\Denormalizer\PrepaidBalanceDenormalizer;
use Apigee\Edge\Api\Monetization\Normalizer\PrepaidBalanceNormalizer;
-class PrepaidBalanceSerializer extends EntitySerializer
+final class PrepaidBalanceSerializer extends EntitySerializer
{
/**
* {@inheritdoc}
diff --git a/src/Api/Monetization/Serializer/RatePlanSerializer.php b/src/Api/Monetization/Serializer/RatePlanSerializer.php
index 292540157..20b99f143 100644
--- a/src/Api/Monetization/Serializer/RatePlanSerializer.php
+++ b/src/Api/Monetization/Serializer/RatePlanSerializer.php
@@ -23,7 +23,7 @@
use Apigee\Edge\Api\Monetization\Normalizer\RatePlanNormalizerFactory;
use Apigee\Edge\Api\Monetization\Normalizer\RatePlanRateNormalizer;
-class RatePlanSerializer extends EntitySerializer
+final class RatePlanSerializer extends EntitySerializer
{
/**
* {@inheritdoc}
diff --git a/src/Api/Monetization/Serializer/ReportDefinitionSerializer.php b/src/Api/Monetization/Serializer/ReportDefinitionSerializer.php
index 4f3270de4..d78a4cab2 100644
--- a/src/Api/Monetization/Serializer/ReportDefinitionSerializer.php
+++ b/src/Api/Monetization/Serializer/ReportDefinitionSerializer.php
@@ -27,7 +27,7 @@
use Apigee\Edge\Api\Monetization\Normalizer\ReportCriteriaNormalizer;
use Apigee\Edge\Api\Monetization\Normalizer\ReportDefinitionNormalizer;
-class ReportDefinitionSerializer extends EntitySerializer
+final class ReportDefinitionSerializer extends EntitySerializer
{
/**
* ReportDefinitionSerializer constructor.
diff --git a/src/Api/Monetization/Serializer/SupportedCurrencySerializer.php b/src/Api/Monetization/Serializer/SupportedCurrencySerializer.php
index 3315f7ceb..0a7d72370 100644
--- a/src/Api/Monetization/Serializer/SupportedCurrencySerializer.php
+++ b/src/Api/Monetization/Serializer/SupportedCurrencySerializer.php
@@ -21,7 +21,7 @@
use Apigee\Edge\Api\Monetization\Denormalizer\SupportedCurrencyDenormalizer;
use Apigee\Edge\Api\Monetization\Normalizer\SupportedCurrencyNormalizer;
-class SupportedCurrencySerializer extends EntitySerializer
+final class SupportedCurrencySerializer extends EntitySerializer
{
/**
* {@inheritdoc}
diff --git a/src/Api/Monetization/Serializer/TermsAndConditionsSerializer.php b/src/Api/Monetization/Serializer/TermsAndConditionsSerializer.php
index 2b261f1f6..48bacebee 100644
--- a/src/Api/Monetization/Serializer/TermsAndConditionsSerializer.php
+++ b/src/Api/Monetization/Serializer/TermsAndConditionsSerializer.php
@@ -21,7 +21,7 @@
use Apigee\Edge\Api\Monetization\Denormalizer\TermsAndConditionsDenormalizer;
use Apigee\Edge\Api\Monetization\Normalizer\TermsAndConditionsNormalizer;
-class TermsAndConditionsSerializer extends EntitySerializer
+final class TermsAndConditionsSerializer extends EntitySerializer
{
/**
* {@inheritdoc}
diff --git a/src/Api/Monetization/Utility/TimezoneFixerHelperTrait.php b/src/Api/Monetization/Utility/TimezoneFixerHelperTrait.php
index 5fdc04e80..e89620cdb 100644
--- a/src/Api/Monetization/Utility/TimezoneFixerHelperTrait.php
+++ b/src/Api/Monetization/Utility/TimezoneFixerHelperTrait.php
@@ -51,7 +51,6 @@ protected function fixTimeZoneOnNormalization($object, $normalized, DateTimeZone
$ro = new ReflectionObject($object);
$dateDenormalizer = new DateTimeNormalizer([DateTimeNormalizer::FORMAT_KEY => EntityInterface::DATE_FORMAT, DateTimeNormalizer::TIMEZONE_KEY => $orgTimezone]);
foreach ($ro->getProperties() as $property) {
- $property->setAccessible(true);
$value = $property->getValue($object);
if ($value instanceof DateTimeImmutable) {
$normalized->{$property->getName()} = $dateDenormalizer->normalize($value, DateTimeImmutable::class);
@@ -86,7 +85,6 @@ protected function fixTimeZoneOnDenormalization($object, $denormalized, DateTime
foreach ($object as $prop_name => $prop_value) {
if ($ro->hasProperty($prop_name)) {
$property = $ro->getProperty($prop_name);
- $property->setAccessible(true);
$value = $property->getValue($denormalized);
if ($value instanceof DateTimeImmutable) {
$property->setValue($denormalized, $dateDenormalizer->denormalize($prop_value, DateTimeImmutable::class));
diff --git a/src/Client.php b/src/Client.php
index 71e953742..f426aa237 100644
--- a/src/Client.php
+++ b/src/Client.php
@@ -49,6 +49,7 @@
* Default API client implementation for Apigee Edge.
*
* @psalm-suppress DeprecatedInterface - DeprecatedInterface will be replaced in 3.x branch.
+ * @psalm-suppress ClassMustBeFinal
*/
class Client implements ClientInterface
{
diff --git a/src/Controller/PaginationHelperTrait.php b/src/Controller/PaginationHelperTrait.php
index 4ceccf8d2..1f1fb090e 100644
--- a/src/Controller/PaginationHelperTrait.php
+++ b/src/Controller/PaginationHelperTrait.php
@@ -111,11 +111,10 @@ protected function listEntities(?PagerInterface $pager = null, array $query_para
if (OrganizationFeatures::isPaginationAvailable($organization)) {
return $this->listEntitiesWithCps($pager, $query_params, $key_provider);
- } else {
- $this->triggerCpsSimulationNotice($pager);
-
- return $this->listEntitiesWithoutCps($pager, $query_params, $key_provider);
}
+ $this->triggerCpsSimulationNotice($pager);
+
+ return $this->listEntitiesWithoutCps($pager, $query_params, $key_provider);
}
/**
@@ -136,11 +135,10 @@ protected function listEntityIds(?PagerInterface $pager = null, array $query_par
if (OrganizationFeatures::isCpsEnabled($organization)) {
return $this->listEntityIdsWithCps($pager, $query_params);
- } else {
- $this->triggerCpsSimulationNotice($pager);
-
- return $this->listEntityIdsWithoutCps($pager, $query_params);
}
+ $this->triggerCpsSimulationNotice($pager);
+
+ return $this->listEntityIdsWithoutCps($pager, $query_params);
}
/**
@@ -178,46 +176,45 @@ private function listEntitiesWithCps(?PagerInterface $pager = null, array $query
$responseArray = $this->getResultsInRange($pager, $query_params);
// Ignore entity type key from response, ex.: developer,
// apiproduct, etc.
- $responseArray = reset($responseArray);
+ $responseArray = reset($responseArray) ?: [];
return $this->responseArrayToArrayOfEntities($responseArray, $key_provider);
- } else {
- // Pass an empty pager to load all entities.
- $responseArray = $this->getResultsInRange($this->createPager(), $query_params);
- // Ignore entity type key from response, ex.: developer, apiproduct,
- // etc.
- $responseArray = reset($responseArray);
- if (empty($responseArray)) {
- return [];
- }
- $entities = $this->responseArrayToArrayOfEntities($responseArray, $key_provider);
- $lastEntity = end($entities);
- $lastId = $lastEntity->{$key_provider}();
- do {
- $tmp = $this->getResultsInRange($this->createPager(0, $lastId), $query_params);
- // Ignore entity type key from response, ex.: developer,
- // apiproduct, etc.
- $tmp = reset($tmp);
- // Remove the first item from the list because it is the same
- // as the last item of $entities at this moment.
- // Apigee Edge response always starts with the requested entity
- // (startKey).
- array_shift($tmp);
- $tmpEntities = $this->responseArrayToArrayOfEntities((array) $tmp, $key_provider);
-
- if (count($tmpEntities) > 0) {
- // The returned entity array is keyed by entity id which
- // is unique so we can do this.
- $entities += $tmpEntities;
- $lastEntity = end($tmpEntities);
- $lastId = $lastEntity->{$key_provider}();
- } else {
- $lastId = false;
- }
- } while ($lastId);
-
- return $entities;
}
+ // Pass an empty pager to load all entities.
+ $responseArray = $this->getResultsInRange($this->createPager(), $query_params);
+ // Ignore entity type key from response, ex.: developer, apiproduct,
+ // etc.
+ $responseArray = reset($responseArray) ?: [];
+ if (empty($responseArray)) {
+ return [];
+ }
+ $entities = $this->responseArrayToArrayOfEntities($responseArray, $key_provider);
+ $lastEntity = end($entities);
+ $lastId = $lastEntity->{$key_provider}();
+ do {
+ $tmp = $this->getResultsInRange($this->createPager(0, $lastId), $query_params);
+ // Ignore entity type key from response, ex.: developer,
+ // apiproduct, etc.
+ $tmp = reset($tmp) ?: [];
+ // Remove the first item from the list because it is the same
+ // as the last item of $entities at this moment.
+ // Apigee Edge response always starts with the requested entity
+ // (startKey).
+ array_shift($tmp);
+ $tmpEntities = $this->responseArrayToArrayOfEntities((array) $tmp, $key_provider);
+
+ if (count($tmpEntities) > 0) {
+ // The returned entity array is keyed by entity id which
+ // is unique so we can do this.
+ $entities += $tmpEntities;
+ $lastEntity = end($tmpEntities);
+ $lastId = $lastEntity->{$key_provider}();
+ } else {
+ $lastId = false;
+ }
+ } while ($lastId);
+
+ return $entities;
}
/**
@@ -245,7 +242,7 @@ private function listEntitiesWithoutCps(?PagerInterface $pager = null, array $qu
$response = $this->getClient()->get($uri);
$responseArray = $this->responseToArray($response);
// Ignore entity type key from response, ex.: apiProduct.
- $responseArray = reset($responseArray);
+ $responseArray = reset($responseArray) ?: [];
$entities = $this->responseArrayToArrayOfEntities($responseArray, $key_provider);
@@ -322,30 +319,29 @@ private function listEntityIdsWithCps(?PagerInterface $pager = null, array $quer
$expandCompatibility = str_ends_with($this->getClient()->getEndpoint(), $baseDomain);
if ($pager) {
return $this->getResultsInRange($pager, $query_params, $expandCompatibility);
- } else {
- $ids = $this->getResultsInRange($this->createPager(), $query_params, $expandCompatibility);
- if (empty($ids)) {
- return [];
- }
- $lastId = end($ids);
- do {
- $tmp = $this->getResultsInRange($this->createPager(0, $lastId), $query_params, $expandCompatibility);
- // Remove the first item from the list because it is the same
- // as the current last item of $ids.
- // Apigee Edge response always starts with the requested entity
- // id (startKey).
- array_shift($tmp);
-
- if (count($tmp) > 0) {
- $ids = array_merge($ids, $tmp);
- $lastId = end($tmp);
- } else {
- $lastId = false;
- }
- } while ($lastId);
-
- return $ids;
}
+ $ids = $this->getResultsInRange($this->createPager(), $query_params, $expandCompatibility);
+ if (empty($ids)) {
+ return [];
+ }
+ $lastId = end($ids);
+ do {
+ $tmp = $this->getResultsInRange($this->createPager(0, $lastId), $query_params, $expandCompatibility);
+ // Remove the first item from the list because it is the same
+ // as the current last item of $ids.
+ // Apigee Edge response always starts with the requested entity
+ // id (startKey).
+ array_shift($tmp);
+
+ if (count($tmp) > 0) {
+ $ids = array_merge($ids, $tmp);
+ $lastId = end($tmp);
+ } else {
+ $lastId = false;
+ }
+ } while ($lastId);
+
+ return $ids;
}
/**
@@ -394,7 +390,7 @@ private function simulateCpsPagination(PagerInterface $pager, array $result, ?ar
$array_search_haystack = $array_search_haystack ?? $result;
// If start key is null let's set it to the first key in the
// result just like the API would do.
- $start_key = $pager->getStartKey() ?? reset($array_search_haystack);
+ $start_key = $pager->getStartKey() ?? (reset($array_search_haystack) ?: '');
$offset = array_search($start_key, $array_search_haystack);
// Start key has not been found in the response. Apigee Edge with
// CPS enabled would return an HTTP 404, with error code
diff --git a/src/Denormalizer/AttributesPropertyDenormalizer.php b/src/Denormalizer/AttributesPropertyDenormalizer.php
index 24e3a6bc1..ef88a1af3 100644
--- a/src/Denormalizer/AttributesPropertyDenormalizer.php
+++ b/src/Denormalizer/AttributesPropertyDenormalizer.php
@@ -23,7 +23,7 @@
/**
* Class AttributesPropertyDenormalizer.
*/
-class AttributesPropertyDenormalizer extends KeyValueMapDenormalizer
+final class AttributesPropertyDenormalizer extends KeyValueMapDenormalizer
{
/**
* {@inheritdoc}
diff --git a/src/Denormalizer/CredentialProductDenormalizer.php b/src/Denormalizer/CredentialProductDenormalizer.php
index 98dde4695..4b89bbc3a 100644
--- a/src/Denormalizer/CredentialProductDenormalizer.php
+++ b/src/Denormalizer/CredentialProductDenormalizer.php
@@ -25,7 +25,7 @@
/**
* Class CredentialProductDenormalizer.
*/
-class CredentialProductDenormalizer implements DenormalizerInterface
+final class CredentialProductDenormalizer implements DenormalizerInterface
{
/**
* {@inheritdoc}
@@ -37,7 +37,7 @@ public function supportsDenormalization($data, $type, $format = null, array $con
return false;
}
- return CredentialProductInterface::class === $type || $type instanceof CredentialProductInterface || in_array(CredentialProductInterface::class, class_implements($type));
+ return CredentialProductInterface::class === $type || $type instanceof CredentialProductInterface || in_array(CredentialProductInterface::class, class_implements($type) ?: []);
}
/**
diff --git a/src/Denormalizer/EdgeDateDenormalizer.php b/src/Denormalizer/EdgeDateDenormalizer.php
index 23719461f..50dfe5e62 100644
--- a/src/Denormalizer/EdgeDateDenormalizer.php
+++ b/src/Denormalizer/EdgeDateDenormalizer.php
@@ -28,7 +28,7 @@
/**
* Class EdgeDateDenormalizer.
*/
-class EdgeDateDenormalizer implements DenormalizerInterface
+final class EdgeDateDenormalizer implements DenormalizerInterface
{
private static $supportedTypes = [
DateTimeInterface::class => true,
diff --git a/src/Denormalizer/KeyValueMapDenormalizer.php b/src/Denormalizer/KeyValueMapDenormalizer.php
index 5ea9c20a7..a31745721 100644
--- a/src/Denormalizer/KeyValueMapDenormalizer.php
+++ b/src/Denormalizer/KeyValueMapDenormalizer.php
@@ -44,7 +44,7 @@ public function supportsDenormalization($data, $type, $format = null, array $con
return false;
}
- return KeyValueMapInterface::class === $type || $type instanceof KeyValueMapInterface || in_array(KeyValueMapInterface::class, class_implements($type));
+ return KeyValueMapInterface::class === $type || $type instanceof KeyValueMapInterface || in_array(KeyValueMapInterface::class, class_implements($type) ?: []);
}
/**
diff --git a/src/Denormalizer/PropertiesPropertyDenormalizer.php b/src/Denormalizer/PropertiesPropertyDenormalizer.php
index fd13d21bc..d0e7aaaa4 100644
--- a/src/Denormalizer/PropertiesPropertyDenormalizer.php
+++ b/src/Denormalizer/PropertiesPropertyDenormalizer.php
@@ -23,7 +23,7 @@
/**
* Class PropertiesPropertyDenormalizer.
*/
-class PropertiesPropertyDenormalizer extends KeyValueMapDenormalizer
+final class PropertiesPropertyDenormalizer extends KeyValueMapDenormalizer
{
/**
* {@inheritdoc}
diff --git a/src/Exception/ApigeeOnGcpOauth2AuthenticationException.php b/src/Exception/ApigeeOnGcpOauth2AuthenticationException.php
index cf7ce1a91..1dcdd78bb 100644
--- a/src/Exception/ApigeeOnGcpOauth2AuthenticationException.php
+++ b/src/Exception/ApigeeOnGcpOauth2AuthenticationException.php
@@ -21,6 +21,6 @@
/**
* For ApigeeOnGcpOauth2Authentication authentication issues.
*/
-class ApigeeOnGcpOauth2AuthenticationException extends ApiException
+final class ApigeeOnGcpOauth2AuthenticationException extends ApiException
{
}
diff --git a/src/Exception/ClientErrorException.php b/src/Exception/ClientErrorException.php
index bb721e2b4..be2601043 100644
--- a/src/Exception/ClientErrorException.php
+++ b/src/Exception/ClientErrorException.php
@@ -23,6 +23,6 @@
*
* For >= 400 and < 500 HTTP codes.
*/
-class ClientErrorException extends ApiResponseException
+final class ClientErrorException extends ApiResponseException
{
}
diff --git a/src/Exception/CpsNotEnabledException.php b/src/Exception/CpsNotEnabledException.php
index adb337f1b..beb1d5c5d 100644
--- a/src/Exception/CpsNotEnabledException.php
+++ b/src/Exception/CpsNotEnabledException.php
@@ -30,7 +30,7 @@
* @see https://docs.apigee.com/api-services/content/api-reference-getting-started#cps
* @deprecated Since 2.0.1, https://github.com/apigee/apigee-client-php/pull/43/files
*/
-class CpsNotEnabledException extends RuntimeException
+final class CpsNotEnabledException extends RuntimeException
{
/**
* @var string
diff --git a/src/Exception/HybridOauth2AuthenticationException.php b/src/Exception/HybridOauth2AuthenticationException.php
index b9f2cfd79..fb361a2c1 100644
--- a/src/Exception/HybridOauth2AuthenticationException.php
+++ b/src/Exception/HybridOauth2AuthenticationException.php
@@ -24,6 +24,6 @@
* @deprecated in 2.0.9, will be removed in 3.0.0.
* https://github.com/apigee/apigee-client-php/issues/112
*/
-class HybridOauth2AuthenticationException extends ApiException
+final class HybridOauth2AuthenticationException extends ApiException
{
}
diff --git a/src/Exception/InvalidArgumentException.php b/src/Exception/InvalidArgumentException.php
index 0460e7178..bda2c1ebf 100644
--- a/src/Exception/InvalidArgumentException.php
+++ b/src/Exception/InvalidArgumentException.php
@@ -21,6 +21,6 @@
/**
* This library's own invalid argument exception.
*/
-class InvalidArgumentException extends \InvalidArgumentException implements ApiClientException
+final class InvalidArgumentException extends \InvalidArgumentException implements ApiClientException
{
}
diff --git a/src/Exception/InvalidJsonException.php b/src/Exception/InvalidJsonException.php
index 97e574cc7..2d7e55e10 100644
--- a/src/Exception/InvalidJsonException.php
+++ b/src/Exception/InvalidJsonException.php
@@ -26,7 +26,7 @@
/**
* Class InvalidJsonException.
*/
-class InvalidJsonException extends ApiResponseException
+final class InvalidJsonException extends ApiResponseException
{
/** @var string */
protected $jsonErrorMessage;
diff --git a/src/Exception/OauthAccessTokenAuthenticationException.php b/src/Exception/OauthAccessTokenAuthenticationException.php
index e735ad6e4..bf8bf6cce 100644
--- a/src/Exception/OauthAccessTokenAuthenticationException.php
+++ b/src/Exception/OauthAccessTokenAuthenticationException.php
@@ -21,6 +21,6 @@
/**
* Exception for the case when authentication fails by using Oauth access token.
*/
-class OauthAccessTokenAuthenticationException extends ApiRequestException
+final class OauthAccessTokenAuthenticationException extends ApiRequestException
{
}
diff --git a/src/Exception/OauthAuthenticationException.php b/src/Exception/OauthAuthenticationException.php
index 3c12b578e..27eb565af 100644
--- a/src/Exception/OauthAuthenticationException.php
+++ b/src/Exception/OauthAuthenticationException.php
@@ -21,6 +21,6 @@
/**
* For OAuth authentication issues.
*/
-class OauthAuthenticationException extends ApiException
+final class OauthAuthenticationException extends ApiException
{
}
diff --git a/src/Exception/OauthRefreshTokenExpiredException.php b/src/Exception/OauthRefreshTokenExpiredException.php
index 6bcd24e2f..0fe2aae36 100644
--- a/src/Exception/OauthRefreshTokenExpiredException.php
+++ b/src/Exception/OauthRefreshTokenExpiredException.php
@@ -21,6 +21,6 @@
/**
* In case if the client is unable refresh access token by using the refresh token because it has expired.
*/
-class OauthRefreshTokenExpiredException extends ApiResponseException
+final class OauthRefreshTokenExpiredException extends ApiResponseException
{
}
diff --git a/src/Exception/ServerErrorException.php b/src/Exception/ServerErrorException.php
index ee36f2a48..6b38a6aa7 100644
--- a/src/Exception/ServerErrorException.php
+++ b/src/Exception/ServerErrorException.php
@@ -23,6 +23,6 @@
*
* For >= 500 HTTP codes.
*/
-class ServerErrorException extends ApiResponseException
+final class ServerErrorException extends ApiResponseException
{
}
diff --git a/src/Exception/UnexpectedValueException.php b/src/Exception/UnexpectedValueException.php
index 7cebda497..54b5ec524 100644
--- a/src/Exception/UnexpectedValueException.php
+++ b/src/Exception/UnexpectedValueException.php
@@ -23,7 +23,7 @@
/**
* Thrown when a value of a property does not match with its expected type.
*/
-class UnexpectedValueException extends BaseUnexpectedValueException implements ApiClientException
+final class UnexpectedValueException extends BaseUnexpectedValueException implements ApiClientException
{
/**
* UnexpectedValueException constructor.
diff --git a/src/Exception/UninitializedPropertyException.php b/src/Exception/UninitializedPropertyException.php
index 70b6db6fb..cb6b2d5c2 100644
--- a/src/Exception/UninitializedPropertyException.php
+++ b/src/Exception/UninitializedPropertyException.php
@@ -28,7 +28,7 @@
*
* @see \Symfony\Component\Serializer\Normalizer\NormalizerInterface::normalize()
*/
-class UninitializedPropertyException extends LogicException implements ApiClientException
+final class UninitializedPropertyException extends LogicException implements ApiClientException
{
/**
* UninitializedPropertyException constructor.
diff --git a/src/HttpClient/Plugin/Authentication/ApigeeOnGcpOauth2.php b/src/HttpClient/Plugin/Authentication/ApigeeOnGcpOauth2.php
index 8dc50bb95..f5e30cf53 100644
--- a/src/HttpClient/Plugin/Authentication/ApigeeOnGcpOauth2.php
+++ b/src/HttpClient/Plugin/Authentication/ApigeeOnGcpOauth2.php
@@ -29,6 +29,8 @@
* ApigeeOnGcpOauth2 authentication plugin for authenticating to GCP API.
*
* @see https://developers.google.com/identity/protocols/OAuth2ServiceAccount
+ *
+ * @psalm-suppress ClassMustBeFinal
*/
class ApigeeOnGcpOauth2 extends AbstractOauth
{
diff --git a/src/HttpClient/Plugin/Authentication/GceServiceAccount.php b/src/HttpClient/Plugin/Authentication/GceServiceAccount.php
index c23b8735a..ab5bdf6e6 100644
--- a/src/HttpClient/Plugin/Authentication/GceServiceAccount.php
+++ b/src/HttpClient/Plugin/Authentication/GceServiceAccount.php
@@ -30,6 +30,8 @@
* Cloud API.
*
* @see https://developers.google.com/identity/protocols/OAuth2ServiceAccount
+ *
+ * @psalm-suppress ClassMustBeFinal
*/
class GceServiceAccount extends AbstractOauth
{
diff --git a/src/HttpClient/Plugin/Authentication/HybridOauth2.php b/src/HttpClient/Plugin/Authentication/HybridOauth2.php
index a85e46a54..5e7c9f629 100644
--- a/src/HttpClient/Plugin/Authentication/HybridOauth2.php
+++ b/src/HttpClient/Plugin/Authentication/HybridOauth2.php
@@ -31,6 +31,8 @@
* @see https://developers.google.com/identity/protocols/OAuth2ServiceAccount
* @deprecated in 2.0.9, will be removed in 3.0.0.
* https://github.com/apigee/apigee-client-php/issues/112
+ *
+ * @psalm-suppress ClassMustBeFinal
*/
class HybridOauth2 extends AbstractOauth
{
diff --git a/src/HttpClient/Plugin/Authentication/NullAuthentication.php b/src/HttpClient/Plugin/Authentication/NullAuthentication.php
index df8ded0db..ef72eff29 100644
--- a/src/HttpClient/Plugin/Authentication/NullAuthentication.php
+++ b/src/HttpClient/Plugin/Authentication/NullAuthentication.php
@@ -24,7 +24,7 @@
/**
* Null authentication.
*/
-class NullAuthentication implements Authentication
+final class NullAuthentication implements Authentication
{
/**
* {@inheritdoc}
diff --git a/src/HttpClient/Plugin/Authentication/Oauth.php b/src/HttpClient/Plugin/Authentication/Oauth.php
index b97d2182f..6c1797e14 100644
--- a/src/HttpClient/Plugin/Authentication/Oauth.php
+++ b/src/HttpClient/Plugin/Authentication/Oauth.php
@@ -29,6 +29,8 @@
* Oauth authentication plugin for authenticating to Apigee Edge with Oauth (SAML).
*
* @see https://apidocs.apigee.com/api-reference/content/using-oauth2-security-apigee-edge-management-api
+ *
+ * @psalm-suppress ClassMustBeFinal
*/
class Oauth extends AbstractOauth
{
diff --git a/src/HttpClient/Plugin/RetryOauthAuthenticationPlugin.php b/src/HttpClient/Plugin/RetryOauthAuthenticationPlugin.php
index fdc272218..c6941b71f 100644
--- a/src/HttpClient/Plugin/RetryOauthAuthenticationPlugin.php
+++ b/src/HttpClient/Plugin/RetryOauthAuthenticationPlugin.php
@@ -29,7 +29,7 @@
/**
* Automatically re-authenticate if a request fails because of an expired access- or refresh token.
*/
-class RetryOauthAuthenticationPlugin implements Plugin
+final class RetryOauthAuthenticationPlugin implements Plugin
{
/**
* @var AbstractOauth
diff --git a/src/HttpClient/Utility/Builder.php b/src/HttpClient/Utility/Builder.php
index 004e443fb..b89d2e9ce 100644
--- a/src/HttpClient/Utility/Builder.php
+++ b/src/HttpClient/Utility/Builder.php
@@ -31,7 +31,7 @@
*
* Helper class that makes creation of HTTP client instances easier.
*/
-class Builder implements BuilderInterface
+final class Builder implements BuilderInterface
{
/** @var ClientInterface */
private $httpClient;
@@ -168,12 +168,10 @@ public function clearPlugins(): void
* Set or remove rebuild flag from the client.
*
* @param bool $rebuild
- *
- * @return bool
*/
- private function needsRebuild(bool $rebuild = true): bool
+ private function needsRebuild(bool $rebuild = true): void
{
- return $this->rebuild = $rebuild;
+ $this->rebuild = $rebuild;
}
/**
diff --git a/src/Normalizer/CredentialProductNormalizer.php b/src/Normalizer/CredentialProductNormalizer.php
index 5c35d928e..2f30dc767 100644
--- a/src/Normalizer/CredentialProductNormalizer.php
+++ b/src/Normalizer/CredentialProductNormalizer.php
@@ -19,12 +19,13 @@
namespace Apigee\Edge\Normalizer;
use Apigee\Edge\Structure\CredentialProductInterface;
+use ArrayObject;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
/**
* Class CredentialProductNormalizer.
*/
-class CredentialProductNormalizer implements NormalizerInterface
+final class CredentialProductNormalizer implements NormalizerInterface
{
/**
* {@inheritdoc}
@@ -32,7 +33,7 @@ class CredentialProductNormalizer implements NormalizerInterface
* @psalm-suppress InvalidReturnType Returning an object here is required
* for creating a valid Apigee Edge request.
*/
- public function normalize($data, $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 \Apigee\Edge\Structure\CredentialProductInterface $data */
$asObject = [
@@ -42,7 +43,7 @@ public function normalize($data, $format = null, array $context = []): array|str
// 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);
}
/**
diff --git a/src/Normalizer/EdgeDateNormalizer.php b/src/Normalizer/EdgeDateNormalizer.php
index a06e96767..994d0d973 100644
--- a/src/Normalizer/EdgeDateNormalizer.php
+++ b/src/Normalizer/EdgeDateNormalizer.php
@@ -18,10 +18,11 @@
namespace Apigee\Edge\Normalizer;
+use ArrayObject;
use DateTimeInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
-class EdgeDateNormalizer implements NormalizerInterface
+final class EdgeDateNormalizer implements NormalizerInterface
{
/**
* {@inheritdoc}
@@ -34,7 +35,7 @@ public function supportsNormalization($data, $format = null, array $context = []
/**
* {@inheritdoc}
*/
- public function normalize($data, $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 \DateTimeInterface $data */
return $data->getTimestamp() * 1000;
diff --git a/src/Normalizer/KeyValueMapNormalizer.php b/src/Normalizer/KeyValueMapNormalizer.php
index c271b823a..1e71d4cd2 100644
--- a/src/Normalizer/KeyValueMapNormalizer.php
+++ b/src/Normalizer/KeyValueMapNormalizer.php
@@ -19,6 +19,7 @@
namespace Apigee\Edge\Normalizer;
use Apigee\Edge\Structure\KeyValueMapInterface;
+use ArrayObject;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
/**
@@ -29,7 +30,7 @@ class KeyValueMapNormalizer implements NormalizerInterface
/**
* {@inheritdoc}
*/
- public function normalize($data, $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
{
$return = [];
foreach ($data->values() as $key => $value) {
diff --git a/src/Normalizer/ObjectNormalizer.php b/src/Normalizer/ObjectNormalizer.php
index 6d277dbe8..263618b6a 100644
--- a/src/Normalizer/ObjectNormalizer.php
+++ b/src/Normalizer/ObjectNormalizer.php
@@ -19,6 +19,7 @@
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;
@@ -93,7 +94,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($data, $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
{
$asArray = $this->objectNormalizer->normalize($data, $this->format, $context);
// Exclude null values from the output, even if PATCH is not supported on Apigee Edge
@@ -129,10 +130,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 dfd41bcd0..c810e4198 100644
--- a/src/Normalizer/PropertiesPropertyNormalizer.php
+++ b/src/Normalizer/PropertiesPropertyNormalizer.php
@@ -19,11 +19,12 @@
namespace Apigee\Edge\Normalizer;
use Apigee\Edge\Structure\PropertiesProperty;
+use ArrayObject;
/**
* Class PropertiesPropertyNormalizer.
*/
-class PropertiesPropertyNormalizer extends KeyValueMapNormalizer
+final class PropertiesPropertyNormalizer extends KeyValueMapNormalizer
{
/**
* Transforms JSON representation of properties property to compatible with what Edge accepts.
@@ -33,7 +34,7 @@ class PropertiesPropertyNormalizer extends KeyValueMapNormalizer
* @psalm-suppress InvalidReturnType Returning an object here is required
* for creating a valid Apigee Edge request.
*/
- public function normalize($data, $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
{
$return = [
'property' => parent::normalize($data, $format, $context),
@@ -41,7 +42,7 @@ public function normalize($data, $format = null, array $context = []): array|str
// 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);
}
/**
diff --git a/src/PropertyAccess/PropertyAccessorDecorator.php b/src/PropertyAccess/PropertyAccessorDecorator.php
index 596e9bfa1..c3ac294b1 100644
--- a/src/PropertyAccess/PropertyAccessorDecorator.php
+++ b/src/PropertyAccess/PropertyAccessorDecorator.php
@@ -155,7 +155,6 @@ private static function processTypeErrorOnGetValue($object, string $property, Ty
if (false !== $pos) {
$ro = new ReflectionObject($object);
$rp = $ro->getProperty($property);
- $rp->setAccessible(true);
$pos += strlen($delim);
$actualValue = $rp->getValue($object);
$expectedType = substr($error->getMessage(), $pos, (int) strpos($error->getMessage(), ',', $pos) - $pos);
diff --git a/src/Serializer/EntitySerializer.php b/src/Serializer/EntitySerializer.php
index ea255a156..b532dd7b9 100755
--- a/src/Serializer/EntitySerializer.php
+++ b/src/Serializer/EntitySerializer.php
@@ -25,6 +25,7 @@
use Apigee\Edge\Normalizer\EdgeDateNormalizer;
use Apigee\Edge\Normalizer\KeyValueMapNormalizer;
use Apigee\Edge\Normalizer\ObjectNormalizer;
+use ArrayObject;
use Psr\Http\Message\ResponseInterface;
use ReflectionMethod;
use ReflectionObject;
@@ -90,7 +91,7 @@ public function supportsDenormalization($data, $type, $format = null, array $con
/**
* {@inheritdoc}
*/
- public function normalize($data, $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
{
return $this->serializer->normalize($data, $format, $context);
}
diff --git a/src/Structure/KeyValueMapInterface.php b/src/Structure/KeyValueMapInterface.php
index e5ee22dc1..e6f6c1685 100644
--- a/src/Structure/KeyValueMapInterface.php
+++ b/src/Structure/KeyValueMapInterface.php
@@ -23,7 +23,7 @@
/**
* Interface KeyValueMapInterface.
*
- * @extends \IteratorAggregate
+ * @extends IteratorAggregate
*/
interface KeyValueMapInterface extends IteratorAggregate
{
diff --git a/src/Structure/ObjectCopyHelperTrait.php b/src/Structure/ObjectCopyHelperTrait.php
index 2958e8622..6f60cbc8e 100644
--- a/src/Structure/ObjectCopyHelperTrait.php
+++ b/src/Structure/ObjectCopyHelperTrait.php
@@ -31,7 +31,6 @@ public function __clone()
{
$ro = new ReflectionObject($this);
foreach ($ro->getProperties() as $property) {
- $property->setAccessible(true);
$value = $property->getValue($this);
if (is_object($value)) {
$property->setValue($this, clone $value);
diff --git a/tests/Api/ApigeeX/Controller/PrepaidBalanceControllerTestBase.php b/tests/Api/ApigeeX/Controller/PrepaidBalanceControllerTestBase.php
index 9689119e6..8fadfbcfc 100644
--- a/tests/Api/ApigeeX/Controller/PrepaidBalanceControllerTestBase.php
+++ b/tests/Api/ApigeeX/Controller/PrepaidBalanceControllerTestBase.php
@@ -90,10 +90,8 @@ public function testGetPrepaidBalance(): void
// We need to prepaid balance serializer from the controller.
$ro = new ReflectionObject(static::entityController());
$property = $ro->getProperty('decorated');
- $property->setAccessible(true);
$ro = new ReflectionObject($property->getValue(static::entityController()));
$rp = $ro->getProperty('prepaidBalanceSerializer');
- $rp->setAccessible(true);
$validator = new PrepaidBalanceSerializerValidator($rp->getValue($property->getValue(static::entityController())));
foreach ($entities as $entity) {
diff --git a/tests/Api/Monetization/Controller/PrepaidBalanceControllerTestBase.php b/tests/Api/Monetization/Controller/PrepaidBalanceControllerTestBase.php
index 0cf1aa440..58bde1029 100644
--- a/tests/Api/Monetization/Controller/PrepaidBalanceControllerTestBase.php
+++ b/tests/Api/Monetization/Controller/PrepaidBalanceControllerTestBase.php
@@ -105,10 +105,8 @@ public function testGetPrepaidBalance(): void
// We need to prepaid balance serializer from the controller.
$ro = new ReflectionObject(static::entityController());
$property = $ro->getProperty('decorated');
- $property->setAccessible(true);
$ro = new ReflectionObject($property->getValue(static::entityController()));
$rp = $ro->getProperty('prepaidBalanceSerializer');
- $rp->setAccessible(true);
$validator = new PrepaidBalanceSerializerValidator($rp->getValue($property->getValue(static::entityController())));
foreach ($entities as $entity) {
$validator->validate($json[$i], $entity);
diff --git a/tests/Api/Monetization/Controller/TimezoneConversionTestTrait.php b/tests/Api/Monetization/Controller/TimezoneConversionTestTrait.php
index 431dabc81..aefeaf5a4 100644
--- a/tests/Api/Monetization/Controller/TimezoneConversionTestTrait.php
+++ b/tests/Api/Monetization/Controller/TimezoneConversionTestTrait.php
@@ -111,7 +111,6 @@ private function getDateProperties(EntityInterface $entity): array
$ro = new ReflectionObject($entity);
foreach ($ro->getProperties() as $property) {
- $property->setAccessible(true);
$value = $property->getValue($entity);
if ($value instanceof DateTimeInterface) {
$properties[] = $property->getName();
diff --git a/tests/Api/Monetization/EntitySerializer/PropertyValidator/PaymentTransactionPropertyValidator.php b/tests/Api/Monetization/EntitySerializer/PropertyValidator/PaymentTransactionPropertyValidator.php
index bff7b681e..0d6749527 100644
--- a/tests/Api/Monetization/EntitySerializer/PropertyValidator/PaymentTransactionPropertyValidator.php
+++ b/tests/Api/Monetization/EntitySerializer/PropertyValidator/PaymentTransactionPropertyValidator.php
@@ -84,7 +84,6 @@ public function validate(stdClass $input, stdClass $output, EntityInterface $ent
unset($expected->organization);
$ro = new ReflectionObject($lentity);
$orgProp = $ro->getProperty('organization');
- $orgProp->setAccessible(true);
// Only way to clear organization.
$orgProp->setValue($lentity, null);
// These properties are missing (not returned by Apigee Edge) on a
diff --git a/tests/PropertyAccess/PropertyAccessorDecoratorTest.php b/tests/PropertyAccess/PropertyAccessorDecoratorTest.php
index 2cdf22a89..0fec63638 100644
--- a/tests/PropertyAccess/PropertyAccessorDecoratorTest.php
+++ b/tests/PropertyAccess/PropertyAccessorDecoratorTest.php
@@ -31,6 +31,10 @@
use Symfony\Component\PropertyAccess\Tests\PropertyAccessorTest;
use TypeError;
+if (!class_exists(PropertyAccessorTest::class)) {
+ return;
+}
+
class PropertyAccessorDecoratorTest extends PropertyAccessorTest
{
use PhpUnitBcBridgeTrait;
@@ -124,7 +128,6 @@ protected function setUp(): void
// class.
$ro = new ReflectionClass(PropertyAccessorTest::class);
$property = $ro->getProperty('propertyAccessor');
- $property->setAccessible(true);
$property->setValue($this, $this->propertyAccessor);
}
@@ -412,11 +415,14 @@ public function testIsReadableWithAsymmetricVisibility(): void
parent::testIsReadableWithAsymmetricVisibility();
}
- public function testSetValueWithAsymmetricVisibility(string $propertyPath = '', ?string $expectedException = null): void
+ /**
+ * @dataProvider Symfony\Component\PropertyAccess\Tests\PropertyAccessorTest::setValueWithAsymmetricVisibilityDataProvider
+ */
+ public function testSetValueWithAsymmetricVisibility(string $propertyPath, ?string $expectedException): void
{
if (PHP_VERSION_ID < 80400) {
$this->markTestSkipped('Requires PHP 8.4');
}
- parent::testSetValueWithAsymmetricVisibility($propertyPath, $expectedException);
+ parent::testSetValueWithAsymmetricVisibility(...func_get_args());
}
}
diff --git a/tests/Serializer/EntitySerializerTest.php b/tests/Serializer/EntitySerializerTest.php
index fad933293..0775cee85 100644
--- a/tests/Serializer/EntitySerializerTest.php
+++ b/tests/Serializer/EntitySerializerTest.php
@@ -174,9 +174,7 @@ public function testSetPropertiesFromResponseWithValidValues(): void
/** @var ReflectionProperty $originalProperty */
/** @var ReflectionProperty $entityProperty */
$originalProperty = $roOriginal->getProperty('propertyWithoutGetter');
- $originalProperty->setAccessible(true);
$entityProperty = $roEntity->getProperty('propertyWithoutGetter');
- $entityProperty->setAccessible(true);
$this->assertEquals($originalProperty->getValue($original), $entityProperty->getValue($entity));
// Ensure that value of a property that uses variable-length
diff --git a/tests/Test/Controller/EntityControllerTestBase.php b/tests/Test/Controller/EntityControllerTestBase.php
index a7f14d19d..e4e0ed302 100644
--- a/tests/Test/Controller/EntityControllerTestBase.php
+++ b/tests/Test/Controller/EntityControllerTestBase.php
@@ -66,10 +66,8 @@ protected function entitySerializer(): EntitySerializerInterface
// a controller.
$ro = new ReflectionObject(static::entityController());
$property = $ro->getProperty('decorated');
- $property->setAccessible(true);
$ro = new ReflectionObject($property->getValue(static::entityController()));
$rm = $ro->getMethod('getEntitySerializer');
- $rm->setAccessible(true);
static::$instance = $rm->invoke($property->getValue(static::entityController()));
}