Skip to content

Commit 7ee03c1

Browse files
committed
Merge branch '2.8' into 3.0
* 2.8: [WebProfilerBundle] Don't inherit CSS text-transform property for the toolbar. Remove duplicate cursor property Increase the inlining YAML level for config:debug [Serializer] Minor: fix CS and PHPDoc [Form] fix tests [Serializer] Ensure that groups are strings [Debug] Tell that the extension is for PHP 5 only Static code analysis Update AnnotationDirectoryLoader.php added a test Escape the delimiter in Glob::toRegex [FrameworkBundle] Fix template location for PHP templates [FrameworkBundle] Add path verification to the template parsing test cases
2 parents b2254e9 + f783dc7 commit 7ee03c1

File tree

6 files changed

+26
-3
lines changed

6 files changed

+26
-3
lines changed

Mapping/Factory/ClassMetadataFactory.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@ class ClassMetadataFactory implements ClassMetadataFactoryInterface
2727
* @var LoaderInterface
2828
*/
2929
private $loader;
30+
3031
/**
3132
* @var Cache
3233
*/
3334
private $cache;
35+
3436
/**
3537
* @var array
3638
*/

Mapping/Loader/YamlFileLoader.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public function loadClassMetadata(ClassMetadataInterface $classMetadata)
6565

6666
if (isset($yaml['attributes']) && is_array($yaml['attributes'])) {
6767
$attributesMetadata = $classMetadata->getAttributesMetadata();
68+
6869
foreach ($yaml['attributes'] as $attribute => $data) {
6970
if (isset($attributesMetadata[$attribute])) {
7071
$attributeMetadata = $attributesMetadata[$attribute];
@@ -74,7 +75,15 @@ public function loadClassMetadata(ClassMetadataInterface $classMetadata)
7475
}
7576

7677
if (isset($data['groups'])) {
78+
if (!is_array($data['groups'])) {
79+
throw new MappingException('The "groups" key must be an array of strings in "%s" for the attribute "%s" of the class "%s".', $this->file, $attribute, $classMetadata->getName());
80+
}
81+
7782
foreach ($data['groups'] as $group) {
83+
if (!is_string($group)) {
84+
throw new MappingException('Group names must be strings in "%s" for the attribute "%s" of the class "%s".', $this->file, $attribute, $classMetadata->getName());
85+
}
86+
7887
$attributeMetadata->addGroup($group);
7988
}
8089
}

NameConverter/CamelCaseToSnakeCaseNameConverter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class CamelCaseToSnakeCaseNameConverter implements NameConverterInterface
2222
* @var array|null
2323
*/
2424
private $attributes;
25+
2526
/**
2627
* @var bool
2728
*/

Normalizer/AbstractNormalizer.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,32 @@ abstract class AbstractNormalizer extends SerializerAwareNormalizer implements N
3333
* @var int
3434
*/
3535
protected $circularReferenceLimit = 1;
36+
3637
/**
3738
* @var callable
3839
*/
3940
protected $circularReferenceHandler;
41+
4042
/**
4143
* @var ClassMetadataFactoryInterface|null
4244
*/
4345
protected $classMetadataFactory;
46+
4447
/**
4548
* @var NameConverterInterface|null
4649
*/
4750
protected $nameConverter;
51+
4852
/**
4953
* @var array
5054
*/
5155
protected $callbacks = array();
56+
5257
/**
5358
* @var array
5459
*/
5560
protected $ignoredAttributes = array();
61+
5662
/**
5763
* @var array
5864
*/

Serializer.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,22 @@ class Serializer implements SerializerInterface, NormalizerInterface, Denormaliz
4141
* @var Encoder\ChainEncoder
4242
*/
4343
protected $encoder;
44+
4445
/**
4546
* @var Encoder\ChainDecoder
4647
*/
4748
protected $decoder;
49+
4850
/**
4951
* @var array
5052
*/
5153
protected $normalizers = array();
54+
5255
/**
5356
* @var array
5457
*/
5558
protected $normalizerCache = array();
59+
5660
/**
5761
* @var array
5862
*/
@@ -247,8 +251,10 @@ private function denormalizeObject($data, $class, $format, array $context = arra
247251
}
248252

249253
foreach ($this->normalizers as $normalizer) {
250-
if ($normalizer instanceof DenormalizerInterface
251-
&& $normalizer->supportsDenormalization($data, $class, $format)) {
254+
if (
255+
$normalizer instanceof DenormalizerInterface &&
256+
$normalizer->supportsDenormalization($data, $class, $format)
257+
) {
252258
return $normalizer->denormalize($data, $class, $format, $context);
253259
}
254260
}

Tests/Normalizer/GetSetMethodNormalizerTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,6 @@ public function provideCallbacks()
343343
array(
344344
array(
345345
'bar' => function ($bar) {
346-
return;
347346
},
348347
),
349348
'baz',

0 commit comments

Comments
 (0)