[Serializer] Add missing @throws annotations
This commit is contained in:
parent
53b7236fa8
commit
b73400d707
@ -59,7 +59,7 @@ class ChainDecoder implements DecoderInterface
|
||||
*
|
||||
* @return DecoderInterface
|
||||
*
|
||||
* @throws RuntimeException if no decoder is found
|
||||
* @throws RuntimeException If no decoder is found.
|
||||
*/
|
||||
private function getDecoder($format)
|
||||
{
|
||||
|
@ -11,6 +11,8 @@
|
||||
|
||||
namespace Symfony\Component\Serializer\Encoder;
|
||||
|
||||
use Symfony\Component\Serializer\Exception\Exception;
|
||||
|
||||
/**
|
||||
* Defines the interface of decoders.
|
||||
*
|
||||
@ -30,6 +32,8 @@ interface DecoderInterface
|
||||
* are encouraged to document which formats they support in a non-inherited
|
||||
* phpdoc comment.
|
||||
*
|
||||
* @throws Exception
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function decode($data, $format, array $context = array());
|
||||
|
@ -11,6 +11,8 @@
|
||||
|
||||
namespace Symfony\Component\Serializer\Encoder;
|
||||
|
||||
use Symfony\Component\Serializer\Exception\Exception;
|
||||
|
||||
/**
|
||||
* Defines the interface of encoders.
|
||||
*
|
||||
@ -25,6 +27,8 @@ interface EncoderInterface
|
||||
* @param string $format Format name
|
||||
* @param array $context options that normalizers/encoders have access to.
|
||||
*
|
||||
* @throws Exception
|
||||
*
|
||||
* @return string|bool|int|float|null
|
||||
*/
|
||||
public function encode($data, $format, array $context = array());
|
||||
|
@ -399,6 +399,8 @@ class XmlEncoder extends SerializerAwareEncoder implements EncoderInterface, Dec
|
||||
* @param \DOMNode $node
|
||||
* @param mixed $val
|
||||
*
|
||||
* @throws UnexpectedValueException
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function selectNodeType(\DOMNode $node, $val)
|
||||
|
@ -11,6 +11,8 @@
|
||||
|
||||
namespace Symfony\Component\Serializer\Normalizer;
|
||||
|
||||
use Symfony\Component\Serializer\Exception\Exception;
|
||||
|
||||
/**
|
||||
* Defines the most basic interface a class must implement to be denormalizable.
|
||||
*
|
||||
@ -33,6 +35,10 @@ interface DenormalizableInterface
|
||||
* @param string|null $format The format is optionally given to be able to denormalize differently
|
||||
* based on different input formats.
|
||||
* @param array $context options for denormalizing
|
||||
*
|
||||
* @throws Exception
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
public function denormalize(DenormalizerInterface $denormalizer, $data, $format = null, array $context = array());
|
||||
}
|
||||
|
@ -11,6 +11,8 @@
|
||||
|
||||
namespace Symfony\Component\Serializer\Normalizer;
|
||||
|
||||
use Symfony\Component\Serializer\Exception\Exception;
|
||||
|
||||
/**
|
||||
* Defines the interface of denormalizers.
|
||||
*
|
||||
@ -26,6 +28,8 @@ interface DenormalizerInterface
|
||||
* @param string $format format the given data was extracted from
|
||||
* @param array $context options available to the denormalizer
|
||||
*
|
||||
* @throws Exception
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
public function denormalize($data, $class, $format = null, array $context = array());
|
||||
|
@ -11,6 +11,8 @@
|
||||
|
||||
namespace Symfony\Component\Serializer\Normalizer;
|
||||
|
||||
use Symfony\Component\Serializer\Exception\Exception;
|
||||
|
||||
/**
|
||||
* Defines the most basic interface a class must implement to be normalizable.
|
||||
*
|
||||
@ -33,6 +35,8 @@ interface NormalizableInterface
|
||||
* based on different output formats.
|
||||
* @param array $context Options for normalizing this object
|
||||
*
|
||||
* @throws Exception
|
||||
*
|
||||
* @return array|string|bool|int|float|null
|
||||
*/
|
||||
public function normalize(NormalizerInterface $normalizer, $format = null, array $context = array());
|
||||
|
@ -11,6 +11,8 @@
|
||||
|
||||
namespace Symfony\Component\Serializer\Normalizer;
|
||||
|
||||
use Symfony\Component\Serializer\Exception\Exception;
|
||||
|
||||
/**
|
||||
* Defines the interface of normalizers.
|
||||
*
|
||||
@ -25,6 +27,8 @@ interface NormalizerInterface
|
||||
* @param string $format format the normalization result will be encoded as
|
||||
* @param array $context Context options for the normalizer
|
||||
*
|
||||
* @throws Exception
|
||||
*
|
||||
* @return array|string|bool|int|float|null
|
||||
*/
|
||||
public function normalize($object, $format = null, array $context = array());
|
||||
|
@ -169,6 +169,8 @@ class Serializer implements SerializerInterface, NormalizerInterface, Denormaliz
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
private function getNormalizer($data, $format = null)
|
||||
{
|
||||
@ -183,6 +185,8 @@ class Serializer implements SerializerInterface, NormalizerInterface, Denormaliz
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
private function getDenormalizer($data, $type, $format = null)
|
||||
{
|
||||
|
@ -11,6 +11,8 @@
|
||||
|
||||
namespace Symfony\Component\Serializer;
|
||||
|
||||
use Symfony\Component\Serializer\Exception\Exception;
|
||||
|
||||
/**
|
||||
* Defines the interface of the Serializer.
|
||||
*
|
||||
@ -25,6 +27,8 @@ interface SerializerInterface
|
||||
* @param string $format format name
|
||||
* @param array $context options normalizers/encoders have access to
|
||||
*
|
||||
* @throws Exception
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function serialize($data, $format, array $context = array());
|
||||
@ -37,6 +41,8 @@ interface SerializerInterface
|
||||
* @param string $format
|
||||
* @param array $context
|
||||
*
|
||||
* @throws Exception
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
public function deserialize($data, $type, $format, array $context = array());
|
||||
|
Reference in New Issue
Block a user