You are here

public function EncoderInterface::encode in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/serializer/Encoder/EncoderInterface.php \Symfony\Component\Serializer\Encoder\EncoderInterface::encode()

Encodes data into the given format.

Parameters

mixed $data Data to encode:

string $format Format name:

array $context options that normalizers/encoders have access to.:

Return value

scalar

Throws

UnexpectedValueException

7 methods override EncoderInterface::encode()
ChainEncoder::encode in vendor/symfony/serializer/Encoder/ChainEncoder.php
Encodes data into the given format.
JsonEncode::encode in vendor/symfony/serializer/Encoder/JsonEncode.php
Encodes PHP data to a JSON string.
JsonEncoder::encode in vendor/symfony/serializer/Encoder/JsonEncoder.php
Encodes data into the given format.
SerializationTestEncoder::encode in core/modules/serialization/tests/serialization_test/src/SerializationTestEncoder.php
Encodes data into the given format.
Serializer::encode in vendor/symfony/serializer/Serializer.php
Encodes data into the given format.

... See full list

File

vendor/symfony/serializer/Encoder/EncoderInterface.php, line 34

Class

EncoderInterface
Defines the interface of encoders.

Namespace

Symfony\Component\Serializer\Encoder

Code

public function encode($data, $format, array $context = array());