Skip to content

Commit 8bf6952

Browse files
committed
minor symfony#54880 [Serializer] Rename object to data in NormalizerInterface::normalize (maxbeckers)
This PR was merged into the 7.2 branch. Discussion ---------- [Serializer] Rename object to data in ``NormalizerInterface::normalize`` | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix symfony#54774 | License | MIT ~~Rename sttribure of ``Serializer::normalize`` to the naming of the interface to make the usage of named attributes possible.~~ From the discussion of this PR I changed it to rename the first parameter of ``NormalizerInterface::normalize`` from `object` to `data` because it can't handle only objects, it's type `mixed`. Commits ------- 26983eb [Serializer] rename the first parameter of ``NormalizerInterface::normalize`` from object to data because of type mixed
2 parents 98f511e + 26983eb commit 8bf6952

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
interface NormalizerInterface
2323
{
2424
/**
25-
* Normalizes an object into a set of arrays/scalars.
25+
* Normalizes data into a set of arrays/scalars.
2626
*
27-
* @param mixed $object Object to normalize
27+
* @param mixed $data Data to normalize
2828
* @param string|null $format Format the normalization result will be encoded as
2929
* @param array $context Context options for the normalizer
3030
*
@@ -36,7 +36,7 @@ interface NormalizerInterface
3636
* @throws LogicException Occurs when the normalizer is not called in an expected context
3737
* @throws ExceptionInterface Occurs for all the other cases of errors
3838
*/
39-
public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null;
39+
public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null;
4040

4141
/**
4242
* Checks whether the given class is supported for normalization by this normalizer.

0 commit comments

Comments
 (0)