e19fe5ce58576cb2c2829d6667344fb411ff18dc
[yaffs-website] / vendor / symfony / serializer / Normalizer / NormalizableInterface.php
1 <?php
2
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 namespace Symfony\Component\Serializer\Normalizer;
13
14 /**
15  * Defines the most basic interface a class must implement to be normalizable.
16  *
17  * If a normalizer is registered for the class and it doesn't implement
18  * the Normalizable interfaces, the normalizer will be used instead.
19  *
20  * @author Jordi Boggiano <j.boggiano@seld.be>
21  */
22 interface NormalizableInterface
23 {
24     /**
25      * Normalizes the object into an array of scalars|arrays.
26      *
27      * It is important to understand that the normalize() call should normalize
28      * recursively all child objects of the implementor.
29      *
30      * @param NormalizerInterface $normalizer The normalizer is given so that you
31      *                                        can use it to normalize objects contained within this object.
32      * @param string|null         $format     The format is optionally given to be able to normalize differently
33      *                                        based on different output formats.
34      * @param array               $context    Options for normalizing this object
35      *
36      * @return array|scalar
37      */
38     public function normalize(NormalizerInterface $normalizer, $format = null, array $context = array());
39 }