@@ -63,9 +63,9 @@ public function supportsNormalization(mixed $data, ?string $format = null, array
6363 }
6464
6565 /**
66- * @param string|null $format
66+ * {@inheritdoc}
6767 */
68- public function getSupportedTypes ($ format ): array
68+ public function getSupportedTypes (? string $ format ): array
6969 {
7070 return self ::FORMAT === $ format ? parent ::getSupportedTypes ($ format ) : [];
7171 }
@@ -77,17 +77,17 @@ public function getSupportedTypes($format): array
7777 *
7878 * @throws UnexpectedValueException
7979 */
80- public function normalize (mixed $ object , ?string $ format = null , array $ context = []): array |string |int |float |bool |\ArrayObject |null
80+ public function normalize (mixed $ data , ?string $ format = null , array $ context = []): array |string |int |float |bool |\ArrayObject |null
8181 {
82- $ resourceClass = $ this ->getObjectClass ($ object );
82+ $ resourceClass = $ this ->getObjectClass ($ data );
8383
8484 if ($ this ->getOutputClass ($ context )) {
8585 $ context ['graphql_identifiers ' ] = [
8686 self ::ITEM_RESOURCE_CLASS_KEY => $ context ['operation ' ]->getClass (),
87- self ::ITEM_IDENTIFIERS_KEY => $ this ->identifiersExtractor ->getIdentifiersFromItem ($ object , $ context ['operation ' ] ?? null ),
87+ self ::ITEM_IDENTIFIERS_KEY => $ this ->identifiersExtractor ->getIdentifiersFromItem ($ data , $ context ['operation ' ] ?? null ),
8888 ];
8989
90- return parent ::normalize ($ object , $ format , $ context );
90+ return parent ::normalize ($ data , $ format , $ context );
9191 }
9292
9393 if ($ this ->isCacheKeySafe ($ context )) {
@@ -97,19 +97,19 @@ public function normalize(mixed $object, ?string $format = null, array $context
9797 }
9898
9999 unset($ context ['operation_name ' ], $ context ['operation ' ]); // Remove operation and operation_name only when cache key has been created
100- $ data = parent ::normalize ($ object , $ format , $ context );
101- if (!\is_array ($ data )) {
100+ $ normalizedData = parent ::normalize ($ data , $ format , $ context );
101+ if (!\is_array ($ normalizedData )) {
102102 throw new UnexpectedValueException ('Expected data to be an array. ' );
103103 }
104104
105105 if (isset ($ context ['graphql_identifiers ' ])) {
106- $ data += $ context ['graphql_identifiers ' ];
106+ $ normalizedData += $ context ['graphql_identifiers ' ];
107107 } elseif (!($ context ['no_resolver_data ' ] ?? false )) {
108- $ data [self ::ITEM_RESOURCE_CLASS_KEY ] = $ resourceClass ;
109- $ data [self ::ITEM_IDENTIFIERS_KEY ] = $ this ->identifiersExtractor ->getIdentifiersFromItem ($ object , $ context ['operation ' ] ?? null );
108+ $ normalizedData [self ::ITEM_RESOURCE_CLASS_KEY ] = $ resourceClass ;
109+ $ normalizedData [self ::ITEM_IDENTIFIERS_KEY ] = $ this ->identifiersExtractor ->getIdentifiersFromItem ($ data , $ context ['operation ' ] ?? null );
110110 }
111111
112- return $ data ;
112+ return $ normalizedData ;
113113 }
114114
115115 /**
@@ -152,12 +152,8 @@ protected function getAllowedAttributes(string|object $classOrObject, array $con
152152
153153 /**
154154 * {@inheritdoc}
155- *
156- * @param object $object
157- * @param string $attribute
158- * @param string|null $format
159155 */
160- protected function setAttributeValue ($ object , $ attribute , mixed $ value , $ format = null , array $ context = []): void
156+ protected function setAttributeValue (object $ object , string $ attribute , mixed $ value , ? string $ format = null , array $ context = []): void
161157 {
162158 if ('_id ' === $ attribute ) {
163159 $ attribute = 'id ' ;
0 commit comments