interface SerializerInterface
@author Jordi Boggiano <j.boggiano@seld.be>
Hierarchy
- interface \Symfony\Component\Serializer\SerializerInterface
Expanded class hierarchy of SerializerInterface
All classes that implement SerializerInterface
13 files declare their use of SerializerInterface
- DefaultExceptionSubscriber.php in core/
modules/ serialization/ src/ EventSubscriber/ DefaultExceptionSubscriber.php - EntityResource.php in core/
modules/ jsonapi/ src/ Controller/ EntityResource.php - MimeMessageNormalizer.php in vendor/
symfony/ serializer/ Normalizer/ MimeMessageNormalizer.php - RequestHandler.php in core/
modules/ rest/ src/ RequestHandler.php - RequestPayloadValueResolver.php in vendor/
symfony/ http-kernel/ Controller/ ArgumentResolver/ RequestPayloadValueResolver.php
File
-
vendor/
symfony/ serializer/ SerializerInterface.php, line 17
Namespace
Symfony\Component\SerializerView source
interface SerializerInterface {
/**
* Serializes data in the appropriate format.
*
* @param array<string, mixed> $context Options normalizers/encoders have access to
*/
public function serialize(mixed $data, string $format, array $context = []) : string;
/**
* Deserializes data into the given type.
*
* @template TObject of object
* @template TType of string|class-string<TObject>
*
* @param TType $type
* @param array<string, mixed> $context
*
* @psalm-return (TType is class-string<TObject> ? TObject : mixed)
*
* @phpstan-return ($type is class-string<TObject> ? TObject : mixed)
*/
public function deserialize(mixed $data, string $type, string $format, array $context = []) : mixed;
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overrides |
---|---|---|---|---|
SerializerInterface::deserialize | public | function | Deserializes data into the given type. | 2 |
SerializerInterface::serialize | public | function | Serializes data in the appropriate format. | 2 |