Skip to content

Commit 897e0c9

Browse files
Merge branch '3.0'
* 3.0: (105 commits) [Console] remove readline support bumped Symfony version to 3.0.3 updated VERSION for 3.0.2 updated CHANGELOG for 3.0.2 [Routing] added a suggestion to add the HttpFoundation component. [FrameworkBundle] fix assets and templating tests [ClassLoader] fix ApcClassLoader tests on HHVM [travis] Add some comments changed operator from and to && [DependencyInjection] Remove unused parameter [Process] Fix transient tests for incremental outputs [Console] Add missing `@require` annotation in test Fix merge [appveyor] Fix failure reporting [#17634] move DebugBundle license file Limit Ldap component version for the 3.0 branch backport GlobTest from 2.7 branch Move licenses according to new best practices [FrameworkBundle] Remove unused code in test [2.3] Fixed an undefined variable in Glob::toRegex ... Conflicts: .travis.yml composer.json src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/assets.php src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/assets.xml src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/assets.yml src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig src/Symfony/Component/Console/CHANGELOG.md src/Symfony/Component/HttpKernel/Kernel.php src/Symfony/Component/PropertyInfo/Tests/PropertyInfoExtractorTest.php src/Symfony/Component/Yaml/Tests/ParserTest.php
2 parents 430b5a1 + 7ee03c1 commit 897e0c9

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
@@ -29,10 +29,12 @@ class ClassMetadataFactory implements ClassMetadataFactoryInterface
2929
* @var LoaderInterface
3030
*/
3131
private $loader;
32+
3233
/**
3334
* @var Cache
3435
*/
3536
private $cache;
37+
3638
/**
3739
* @var array
3840
*/

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
@@ -344,7 +344,6 @@ public function provideCallbacks()
344344
array(
345345
array(
346346
'bar' => function ($bar) {
347-
return;
348347
},
349348
),
350349
'baz',

0 commit comments

Comments
 (0)