Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Serializer] improve phpdoc for normalizer #60769

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ interface DenormalizerInterface
/**
* Denormalizes data back into an object of the given class.
*
* @param mixed $data Data to restore
* @param string $type The expected class to instantiate
* @param string|null $format Format the given data was extracted from
* @param array $context Options available to the denormalizer
* @param mixed $data Data to restore
* @param string $type The expected class to instantiate
* @param string|null $format Format the given data was extracted from
* @param array<string, mixed> $context Options available to the denormalizer
*
* @throws BadMethodCallException Occurs when the normalizer is not called in an expected context
* @throws InvalidArgumentException Occurs when the arguments are not coherent or not supported
Expand All @@ -47,9 +47,10 @@ public function denormalize(mixed $data, string $type, ?string $format = null, a
/**
* Checks whether the given class is supported for denormalization by this normalizer.
*
* @param mixed $data Data to denormalize from
* @param string $type The class to which the data should be denormalized
* @param string|null $format The format being deserialized from
* @param mixed $data Data to denormalize from
* @param string $type The class to which the data should be denormalized
* @param string|null $format The format being deserialized from
* @param array<string, mixed> $context Options available to the denormalizer
*/
public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ interface NormalizerInterface
/**
* Normalizes data into a set of arrays/scalars.
*
* @param mixed $data Data to normalize
* @param string|null $format Format the normalization result will be encoded as
* @param array $context Context options for the normalizer
* @param mixed $data Data to normalize
* @param string|null $format Format the normalization result will be encoded as
* @param array<string, mixed> $context Context options for the normalizer
*
* @return array|string|int|float|bool|\ArrayObject|null \ArrayObject is used to make sure an empty object is encoded as an object not an array
*
Expand All @@ -41,8 +41,9 @@ public function normalize(mixed $data, ?string $format = null, array $context =
/**
* Checks whether the given class is supported for normalization by this normalizer.
*
* @param mixed $data Data to normalize
* @param string|null $format The format being (de-)serialized from or into
* @param mixed $data Data to normalize
* @param string|null $format The format being (de-)serialized from or into
* @param array<string, mixed> $context Context options for the normalizer
*/
public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool;

Expand Down