Upgraded drupal core with security updates
[yaffs-website] / web / core / lib / Drupal / Component / Serialization / SerializationInterface.php
1 <?php
2
3 namespace Drupal\Component\Serialization;
4
5 /**
6  * Defines an interface for serialization formats.
7  */
8 interface SerializationInterface {
9
10   /**
11    * Encodes data into the serialization format.
12    *
13    * @param mixed $data
14    *   The data to encode.
15    *
16    * @return string
17    *   The encoded data.
18    */
19   public static function encode($data);
20
21   /**
22    * Decodes data from the serialization format.
23    *
24    * @param string $raw
25    *   The raw data string to decode.
26    *
27    * @return mixed
28    *   The decoded data.
29    */
30   public static function decode($raw);
31
32   /**
33    * Gets the file extension for this serialization format.
34    *
35    * @return string
36    *   The file extension, without leading dot.
37    */
38   public static function getFileExtension();
39
40 }