From c3ac78992e2b712854ea0c0165ab56cf6c8d6c23 Mon Sep 17 00:00:00 2001 From: Kedar Khaire Date: Fri, 25 Oct 2024 12:25:32 +0530 Subject: [PATCH] Changes for last few fixes --- src/Api/Management/Normalizer/CompanyMembershipNormalizer.php | 2 +- src/Normalizer/CredentialProductNormalizer.php | 2 +- src/Normalizer/ObjectNormalizer.php | 4 ++-- src/Normalizer/PropertiesPropertyNormalizer.php | 2 +- src/Serializer/EntitySerializer.php | 1 + src/Serializer/JsonDecode.php | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Api/Management/Normalizer/CompanyMembershipNormalizer.php b/src/Api/Management/Normalizer/CompanyMembershipNormalizer.php index a1868d42..1bf68937 100644 --- a/src/Api/Management/Normalizer/CompanyMembershipNormalizer.php +++ b/src/Api/Management/Normalizer/CompanyMembershipNormalizer.php @@ -41,7 +41,7 @@ public function normalize($object, $format = null, array $context = []): array|s // 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/Normalizer/CredentialProductNormalizer.php b/src/Normalizer/CredentialProductNormalizer.php index f18710b4..d8e5599d 100644 --- a/src/Normalizer/CredentialProductNormalizer.php +++ b/src/Normalizer/CredentialProductNormalizer.php @@ -42,7 +42,7 @@ public function normalize($object, $format = null, array $context = []): array|s // 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/ObjectNormalizer.php b/src/Normalizer/ObjectNormalizer.php index 18aa1dec..fa729d51 100644 --- a/src/Normalizer/ObjectNormalizer.php +++ b/src/Normalizer/ObjectNormalizer.php @@ -129,10 +129,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 1b3e56dd..12d7247b 100644 --- a/src/Normalizer/PropertiesPropertyNormalizer.php +++ b/src/Normalizer/PropertiesPropertyNormalizer.php @@ -41,7 +41,7 @@ public function normalize($object, $format = null, array $context = []): array|s // 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/Serializer/EntitySerializer.php b/src/Serializer/EntitySerializer.php index bf03a57d..53405fff 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 Apigee\Edge\Serializer\JsonDecode; use Psr\Http\Message\ResponseInterface; use ReflectionMethod; use ReflectionObject; diff --git a/src/Serializer/JsonDecode.php b/src/Serializer/JsonDecode.php index a304fe9e..76dd8953 100644 --- a/src/Serializer/JsonDecode.php +++ b/src/Serializer/JsonDecode.php @@ -79,7 +79,7 @@ public function __construct($defaultContext = [], int $depth = 512) /** * {@inheritdoc} */ - public function decode($data, $format, array $context = []): mixed: mixed + public function decode($data, $format, array $context = []): mixed { $context['json_decode_options'] = empty($context['json_decode_options']) ? $this->options : $context['json_decode_options'];