Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / symfony / serializer / Normalizer / DenormalizerInterface.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 use Symfony\Component\Serializer\Exception\BadMethodCallException;
15 use Symfony\Component\Serializer\Exception\ExtraAttributesException;
16 use Symfony\Component\Serializer\Exception\InvalidArgumentException;
17 use Symfony\Component\Serializer\Exception\LogicException;
18 use Symfony\Component\Serializer\Exception\RuntimeException;
19 use Symfony\Component\Serializer\Exception\UnexpectedValueException;
20
21 /**
22  * Defines the interface of denormalizers.
23  *
24  * @author Jordi Boggiano <j.boggiano@seld.be>
25  */
26 interface DenormalizerInterface
27 {
28     /**
29      * Denormalizes data back into an object of the given class.
30      *
31      * @param mixed  $data    Data to restore
32      * @param string $class   The expected class to instantiate
33      * @param string $format  Format the given data was extracted from
34      * @param array  $context Options available to the denormalizer
35      *
36      * @return object
37      *
38      * @throws BadMethodCallException   Occurs when the normalizer is not called in an expected context
39      * @throws InvalidArgumentException Occurs when the arguments are not coherent or not supported
40      * @throws UnexpectedValueException Occurs when the item cannot be hydrated with the given data
41      * @throws ExtraAttributesException Occurs when the item doesn't have attribute to receive given data
42      * @throws LogicException           Occurs when the normalizer is not supposed to denormalize
43      * @throws RuntimeException         Occurs if the class cannot be instantiated
44      */
45     public function denormalize($data, $class, $format = null, array $context = array());
46
47     /**
48      * Checks whether the given class is supported for denormalization by this normalizer.
49      *
50      * @param mixed  $data   Data to denormalize from
51      * @param string $type   The class to which the data should be denormalized
52      * @param string $format The format being deserialized from
53      *
54      * @return bool
55      */
56     public function supportsDenormalization($data, $type, $format = null);
57 }