Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. EncoderInterface.php

interface EncoderInterface

Same name in this branch
  1. 11.1.x vendor/symfony/mime/Encoder/EncoderInterface.php \Symfony\Component\Mime\Encoder\EncoderInterface

@author Jordi Boggiano <j.boggiano@seld.be>

Hierarchy

  • interface \Symfony\Component\Serializer\Encoder\EncoderInterface

Expanded class hierarchy of EncoderInterface

All classes that implement EncoderInterface

4 files declare their use of EncoderInterface
Serializer.php in vendor/symfony/serializer/Serializer.php
TraceableEncoder.php in vendor/symfony/serializer/Debug/TraceableEncoder.php
TraceableSerializer.php in vendor/symfony/serializer/Debug/TraceableSerializer.php
XmlEncoder.php in core/modules/serialization/src/Encoder/XmlEncoder.php

File

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

Namespace

Symfony\Component\Serializer\Encoder
View source
interface EncoderInterface {
    
    /**
     * Encodes data into the given format.
     *
     * @param mixed  $data    Data to encode
     * @param string $format  Format name
     * @param array  $context Options that normalizers/encoders have access to
     *
     * @throws UnexpectedValueException
     */
    public function encode(mixed $data, string $format, array $context = []) : string;
    
    /**
     * Checks whether the serializer can encode to given format.
     *
     * @param string $format Format name
     */
    public function supportsEncoding(string $format) : bool;

}

Members

Title Sort descending Modifiers Object type Summary Overrides
EncoderInterface::encode public function Encodes data into the given format. 10
EncoderInterface::supportsEncoding public function Checks whether the serializer can encode to given format. 9
RSS feed
Powered by Drupal