diff --git a/src/Symfony/Component/Serializer/Serializer.php b/src/Symfony/Component/Serializer/Serializer.php index c19951a9bd07..23a8a0795b99 100644 --- a/src/Symfony/Component/Serializer/Serializer.php +++ b/src/Symfony/Component/Serializer/Serializer.php @@ -173,9 +173,7 @@ public function supportsDenormalization($data, $type, $format = null) private function getNormalizer($data, $format = null) { foreach ($this->normalizers as $normalizer) { - if ($normalizer instanceof NormalizerInterface - && $normalizer->supportsNormalization($data, $format) - ) { + if ($normalizer instanceof NormalizerInterface && $normalizer->supportsNormalization($data, $format)) { return $normalizer; } } @@ -189,9 +187,7 @@ private function getNormalizer($data, $format = null) private function getDenormalizer($data, $type, $format = null) { foreach ($this->normalizers as $normalizer) { - if ($normalizer instanceof DenormalizerInterface - && $normalizer->supportsDenormalization($data, $type, $format) - ) { + if ($normalizer instanceof DenormalizerInterface && $normalizer->supportsDenormalization($data, $type, $format)) { return $normalizer; } } diff --git a/src/Symfony/Component/Serializer/Tests/Normalizer/TestDenormalizer.php b/src/Symfony/Component/Serializer/Tests/Normalizer/TestDenormalizer.php index ce1c7d2f7fc2..e881ad139761 100644 --- a/src/Symfony/Component/Serializer/Tests/Normalizer/TestDenormalizer.php +++ b/src/Symfony/Component/Serializer/Tests/Normalizer/TestDenormalizer.php @@ -20,19 +20,18 @@ */ class TestDenormalizer implements DenormalizerInterface { - /** - * {@inheritdoc} - */ - public function denormalize($data, $class, $format = null, array $context = array()) - { + /** + * {@inheritdoc} + */ + public function denormalize($data, $class, $format = null, array $context = array()) + { + } - } - - /** - * {@inheritdoc} - */ - public function supportsDenormalization($data, $type, $format = null) - { - return TRUE; - } + /** + * {@inheritdoc} + */ + public function supportsDenormalization($data, $type, $format = null) + { + return true; + } } diff --git a/src/Symfony/Component/Serializer/Tests/Normalizer/TestNormalizer.php b/src/Symfony/Component/Serializer/Tests/Normalizer/TestNormalizer.php index 149c4021105a..4c000b3eb44a 100644 --- a/src/Symfony/Component/Serializer/Tests/Normalizer/TestNormalizer.php +++ b/src/Symfony/Component/Serializer/Tests/Normalizer/TestNormalizer.php @@ -20,19 +20,18 @@ */ class TestNormalizer implements NormalizerInterface { - /** - * {@inheritdoc} - */ - public function normalize($object, $format = null, array $context = array()) - { - - } + /** + * {@inheritdoc} + */ + public function normalize($object, $format = null, array $context = array()) + { + } - /** - * {@inheritdoc} - */ - public function supportsNormalization($data, $format = null) - { - return TRUE; - } + /** + * {@inheritdoc} + */ + public function supportsNormalization($data, $format = null) + { + return true; + } } diff --git a/src/Symfony/Component/Serializer/Tests/SerializerTest.php b/src/Symfony/Component/Serializer/Tests/SerializerTest.php index 99ec90cfe323..3c189461f28f 100644 --- a/src/Symfony/Component/Serializer/Tests/SerializerTest.php +++ b/src/Symfony/Component/Serializer/Tests/SerializerTest.php @@ -50,8 +50,8 @@ public function testNormalizeGivesPriorityToInterfaceOverTraversable() */ public function testNormalizeOnDenormalizer() { - $this->serializer = new Serializer(array(new TestDenormalizer()), array()); - $this->assertTrue($this->serializer->normalize(new \stdClass, 'json')); + $this->serializer = new Serializer(array(new TestDenormalizer()), array()); + $this->assertTrue($this->serializer->normalize(new \stdClass, 'json')); } /** @@ -68,9 +68,9 @@ public function testDenormalizeNoMatch() */ public function testDenormalizeOnNormalizer() { - $this->serializer = new Serializer(array(new TestNormalizer()), array()); - $data = array('title' => 'foo', 'numbers' => array(5, 3)); - $this->assertTrue($this->serializer->denormalize(json_encode($data), 'stdClass', 'json')); + $this->serializer = new Serializer(array(new TestNormalizer()), array()); + $data = array('title' => 'foo', 'numbers' => array(5, 3)); + $this->assertTrue($this->serializer->denormalize(json_encode($data), 'stdClass', 'json')); } public function testSerialize() @@ -244,5 +244,4 @@ public function toArray() { return array('title' => $this->title, 'numbers' => $this->numbers); } - }