Skip to content
Permalink
Browse files

minor #32046 [FrameworkBundle] Unconditionally register the DateInter…

…valNormalizer (ogizanagi)

This PR was merged into the 4.2 branch.

Discussion
----------

[FrameworkBundle] Unconditionally register the DateIntervalNormalizer

| Q             | A
| ------------- | ---
| Branch?       | 4.2 <!-- see below -->
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | N/A   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

Fwb conflicts with serializer <4.2 https://github.com/symfony/symfony/blob/37fa45bbd1553ee5ce6efdb79bd003b7327f7376/src/Symfony/Bundle/FrameworkBundle/composer.json#L74

so we can remove this obsolete condition from the extension (DateIntervalNormalizer exists since 3.4).

Commits
-------

c7cc780 [FrameworkBundle] Unconditionally register the DateIntervalNormalizer
  • Loading branch information...
ogizanagi committed Jul 1, 2019
2 parents b8c4809 + c7cc780 commit 26048bc4988284a730dde9b9a323d5853a7aa7a9
@@ -89,7 +89,6 @@
use Symfony\Component\Serializer\Mapping\ClassDiscriminatorFromClassMetadata;
use Symfony\Component\Serializer\Mapping\Factory\CacheClassMetadataFactory;
use Symfony\Component\Serializer\Normalizer\ConstraintViolationListNormalizer;
use Symfony\Component\Serializer\Normalizer\DateIntervalNormalizer;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
use Symfony\Component\Stopwatch\Stopwatch;
@@ -1316,10 +1315,6 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
{
$loader->load('serializer.xml');
if (!class_exists(DateIntervalNormalizer::class)) {
$container->removeDefinition('serializer.normalizer.dateinterval');
}
if (!class_exists(ConstraintViolationListNormalizer::class)) {
$container->removeDefinition('serializer.normalizer.constraint_violation_list');
}
@@ -1102,10 +1102,6 @@ public function testDataUriNormalizerRegistered()
public function testDateIntervalNormalizerRegistered()
{
if (!class_exists(DateIntervalNormalizer::class)) {
$this->markTestSkipped('The DateIntervalNormalizer has been introduced in the Serializer Component version 3.4.');
}
$container = $this->createContainerFromFile('full');
$definition = $container->getDefinition('serializer.normalizer.dateinterval');

0 comments on commit 26048bc

Please sign in to comment.
You can’t perform that action at this time.