Skip to content

Commit

Permalink
[FrameworkBundle] Unconditionally register the DateIntervalNormalizer
Browse files Browse the repository at this point in the history
  • Loading branch information
ogizanagi committed Jun 14, 2019
1 parent 37fa45b commit c7cc780
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -1312,10 +1311,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');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit c7cc780

Please sign in to comment.