This repository has been archived on 2025-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
drupalcampbristol/core/lib/Drupal/Component/Serialization/SerializationInterface.php

46 lines
849 B
PHP

<?php
/**
* @file
* Contains \Drupal\Component\Serialization\SerializationInterface.
*/
namespace Drupal\Component\Serialization;
/**
* Defines an interface for serialization formats.
*/
interface SerializationInterface {
/**
* Encodes data into the serialization format.
*
* @param mixed $data
* The data to encode.
*
* @return string
* The encoded data.
*/
public static function encode($data);
/**
* Decodes data from the serialization format.
*
* @param string $raw
* The raw data string to decode.
*
* @return mixed
* The decoded data.
*/
public static function decode($raw);
/**
* Gets the file extension for this serialization format.
*
* @return string
* The file extension, without leading dot.
*/
public static function getFileExtension();
}