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

Breadcrumb

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

interface DecoderInterface

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

Hierarchy

  • interface \Symfony\Component\Serializer\Encoder\DecoderInterface

Expanded class hierarchy of DecoderInterface

All classes that implement DecoderInterface

4 files declare their use of DecoderInterface
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/DecoderInterface.php, line 19

Namespace

Symfony\Component\Serializer\Encoder
View source
interface DecoderInterface {
    
    /**
     * Decodes a string into PHP data.
     *
     * @param string $data    Data to decode
     * @param string $format  Format name
     * @param array  $context Options that decoders have access to
     *
     * The format parameter specifies which format the data is in; valid values
     * depend on the specific implementation. Authors implementing this interface
     * are encouraged to document which formats they support in a non-inherited
     * phpdoc comment.
     *
     * @throws UnexpectedValueException
     */
    public function decode(string $data, string $format, array $context = []) : mixed;
    
    /**
     * Checks whether the deserializer can decode from given format.
     *
     * @param string $format Format name
     */
    public function supportsDecoding(string $format) : bool;

}

Members

Title Sort descending Modifiers Object type Summary Overrides
DecoderInterface::decode public function Decodes a string into PHP data. 10
DecoderInterface::supportsDecoding public function Checks whether the deserializer can decode from given format. 9
RSS feed
Powered by Drupal