[Serializer] Minor: fix CS and PHPDoc

This commit is contained in:
Kévin Dunglas 2016-01-18 22:15:26 +01:00 committed by Fabien Potencier
parent 234011d776
commit ff568dc518
5 changed files with 18 additions and 2 deletions

View File

@ -27,10 +27,12 @@ class ClassMetadataFactory implements ClassMetadataFactoryInterface
* @var LoaderInterface
*/
private $loader;
/**
* @var Cache
*/
private $cache;
/**
* @var array
*/

View File

@ -65,6 +65,7 @@ class YamlFileLoader extends FileLoader
if (isset($yaml['attributes']) && is_array($yaml['attributes'])) {
$attributesMetadata = $classMetadata->getAttributesMetadata();
foreach ($yaml['attributes'] as $attribute => $data) {
if (isset($attributesMetadata[$attribute])) {
$attributeMetadata = $attributesMetadata[$attribute];

View File

@ -22,6 +22,7 @@ class CamelCaseToSnakeCaseNameConverter implements NameConverterInterface
* @var array|null
*/
private $attributes;
/**
* @var bool
*/

View File

@ -35,26 +35,32 @@ abstract class AbstractNormalizer extends SerializerAwareNormalizer implements N
* @var int
*/
protected $circularReferenceLimit = 1;
/**
* @var callable
*/
protected $circularReferenceHandler;
/**
* @var ClassMetadataFactoryInterface|null
*/
protected $classMetadataFactory;
/**
* @var NameConverterInterface|null
*/
protected $nameConverter;
/**
* @var array
*/
protected $callbacks = array();
/**
* @var array
*/
protected $ignoredAttributes = array();
/**
* @var array
*/

View File

@ -41,18 +41,22 @@ class Serializer implements SerializerInterface, NormalizerInterface, Denormaliz
* @var Encoder\ChainEncoder
*/
protected $encoder;
/**
* @var Encoder\ChainDecoder
*/
protected $decoder;
/**
* @var array
*/
protected $normalizers = array();
/**
* @var array
*/
protected $normalizerCache = array();
/**
* @var array
*/
@ -247,8 +251,10 @@ class Serializer implements SerializerInterface, NormalizerInterface, Denormaliz
}
foreach ($this->normalizers as $normalizer) {
if ($normalizer instanceof DenormalizerInterface
&& $normalizer->supportsDenormalization($data, $class, $format)) {
if (
$normalizer instanceof DenormalizerInterface &&
$normalizer->supportsDenormalization($data, $class, $format)
) {
return $normalizer->denormalize($data, $class, $format, $context);
}
}