8000 [Serializer] fixed CS (refs #7971) · symfony/symfony@e318759 · GitHub
[go: up one dir, main page]

Skip to content

Commit e318759

Browse files
committed
[Serializer] fixed CS (refs #7971)
1 parent a5ab1aa commit e318759

File tree

4 files changed

+33
-40
lines changed

4 files changed

+33
-40
lines changed

src/Symfony/Component/Serializer/Serializer.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,7 @@ public function supportsDenormalization($data, $type, $format = null)
173173
private function getNormalizer($data, $format = null)
174174
{
175175
foreach ($this->normalizers as $normalizer) {
176-
if ($normalizer instanceof NormalizerInterface
177-
&& $normalizer->supportsNormalization($data, $format)
178-
) {
176+
if ($normalizer instanceof NormalizerInterface && $normalizer->supportsNormalization($data, $format)) {
179177
return $normalizer;
180178
}
181179
}
@@ -189,9 +187,7 @@ private function getNormalizer($data, $format = null)
189187
private function getDenormalizer($data, $type, $format = null)
190188
{
191189
foreach ($this->normalizers as $normalizer) {
192-
if ($normalizer instanceof DenormalizerInterface
193-
&& $normalizer->supportsDenormalization($data, $type, $format)
194-
) {
190+
if ($normalizer instanceof DenormalizerInterface && $normalizer->supportsDenormalization($data, $type, $format)) {
195191
return $normalizer;
196192
}
197193
}

src/Symfony/Component/Serializer/Tests/Normalizer/TestDenormalizer.php

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,18 @@
2020
*/
2121
class TestDenormalizer implements DenormalizerInterface
2222
{
23-
/**
24-
* {@inheritdoc}
25-
*/
26-
public function denormalize($data, $class, $format = null, array $context = array())
27-
{
23+
/**
24+
* {@inheritdoc}
25+
*/
26+
public function denormalize($data, $class, $format = null, array $context = array())
27+
{
28+
}
2829

29-
}
30-
31-
/**
32-
* {@inheritdoc}
33-
*/
34-
public function supportsDenormalization($data, $type, $format = null)
35-
{
36-
return TRUE;
37-
}
30+
/**
31+
* {@inheritdoc}
32+
*/
33+
public function supportsDenormalization($data, $type, $format = null)
34+
{
35+
return true;
36+
}
3837
}

src/Symfony/Component/Serializer/Tests/Normalizer/TestNormalizer.php

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,18 @@
2020
*/
2121
class TestNormalizer implements NormalizerInterface
2222
{
23-
/**
24-
* {@inheritdoc}
25-
*/
26-
public function normalize($object, $format = null, array $context = array())
27-
{
28-
29-
}
23+
/**
24+
* {@inheritdoc}
25+
*/
26+
public function normalize($object, $format = null, array $context = array())
27+
{
28+
}
3029

31-
/**
32-
* {@inheritdoc}
33-
*/
34-
public function supportsNormalization($data, $format = null)
35-
{
36-
return TRUE;
37-
}
30+
/**
31+
* {@inheritdoc}
32+
*/
33+
public function supportsNormalization($data, $format = null)
34+
{
35+
return true;
36+
}
3837
}

src/Symfony/Component/Serializer/Tests/SerializerTest.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ public function testNormalizeGivesPriorityToInterfaceOverTraversable()
5050
*/
5151
public function testNormalizeOnDenormalizer()
5252
{
53-
$this->serializer = new Serializer(array(new TestDenormalizer()), array());
54-
$this->assertTrue($this->serializer->normalize(new \stdClass, 'json'));
53+
$this->serializer = new Serializer(array(new TestDenormalizer()), array());
54+
$this->assertTrue($this->serializer->normalize(new \stdClass, 'json'));
5555
}
5656

5757
/**
@@ -68,9 +68,9 @@ public function testDenormalizeNoMatch()
6868
*/
6969
public function testDenormalizeOnNormalizer()
7070
{
71-
$this->serializer = new Serializer(array(new TestNormalizer()), array());
72-
$data = array('title' => 'foo', 'numbers' => array(5, 3));
73-
$this->assertTrue($this->serializer->denormalize(json_encode($data), 'stdClass', 'json'));
71+
$this->serializer = new Serializer(array(new TestNormalizer()), array());
72+
$data = array('title' => 'foo', 'numbers' => array(5, 3));
73+
$this->assertTrue($this->serializer->denormalize(json_encode($data), 'stdClass', 'json'));
7474
}
7575

7676
public function testSerialize()
@@ -244,5 +244,4 @@ public function toArray()
244244
{
245245
return array('title' => $this->title, 'numbers' => $this->numbers);
246246
}
247-
248247
}

0 commit comments

Comments
 (0)
0