From a27f81c581eeede260edd05876a6e4d67556f46f Mon Sep 17 00:00:00 2001 From: Jelle van Oosterbosch Date: Tue, 11 Feb 2020 13:43:26 +0100 Subject: [PATCH] Fixed code style with cs-fixer --- Serializer/Normalizer/IterableNormalizer.php | 7 ++++--- .../Normalizer/AnnotationNormalizerTest.php | 5 ++--- .../Normalizer/IterableNormalizerTest.php | 15 ++++++++------- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/Serializer/Normalizer/IterableNormalizer.php b/Serializer/Normalizer/IterableNormalizer.php index ccdbd9b..78fd262 100644 --- a/Serializer/Normalizer/IterableNormalizer.php +++ b/Serializer/Normalizer/IterableNormalizer.php @@ -3,11 +3,12 @@ * This file is part of the GDPR bundle. * * @category Bundle - * @package Gdpr + * * @author SuperBrave * @copyright 2018 SuperBrave * @license https://github.com/superbrave/gdpr-bundle/blob/master/LICENSE MIT - * @link https://www.superbrave.nl/ + * + * @see https://www.superbrave.nl/ */ namespace Superbrave\GdprBundle\Serializer\Normalizer; @@ -40,7 +41,7 @@ public function supportsNormalization($data, $format = null) /** * {@inheritdoc} */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { $normalizedData = []; diff --git a/Tests/Serializer/Normalizer/AnnotationNormalizerTest.php b/Tests/Serializer/Normalizer/AnnotationNormalizerTest.php index 02c33fa..8aacd78 100644 --- a/Tests/Serializer/Normalizer/AnnotationNormalizerTest.php +++ b/Tests/Serializer/Normalizer/AnnotationNormalizerTest.php @@ -13,7 +13,6 @@ namespace Superbrave\GdprBundle\Tests\Serializer\Normalizer; -use Doctrine\Common\Collections\ArrayCollection; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use ReflectionClass; @@ -209,7 +208,7 @@ public function testNormalizeThroughXmlSerializer(): void $data = new AnnotatedMock(new AnnotatedMock()); $this->assertStringEqualsFile( - __DIR__ . '/../../Resources/xml/annotation_normalizer_result.xml', + __DIR__.'/../../Resources/xml/annotation_normalizer_result.xml', $serializer->serialize($data, 'xml') ); } @@ -242,7 +241,7 @@ public function testNormalizeThroughJsonSerializer(): void $data = new AnnotatedMock(new AnnotatedMock()); $this->assertStringEqualsFile( - __DIR__ . '/../../Resources/json/annotation_normalize_result.json', + __DIR__.'/../../Resources/json/annotation_normalize_result.json', $serializer->serialize($data, 'json') ); } diff --git a/Tests/Serializer/Normalizer/IterableNormalizerTest.php b/Tests/Serializer/Normalizer/IterableNormalizerTest.php index 2f39c60..7479d4d 100644 --- a/Tests/Serializer/Normalizer/IterableNormalizerTest.php +++ b/Tests/Serializer/Normalizer/IterableNormalizerTest.php @@ -3,11 +3,12 @@ * This file is part of the GDPR bundle. * * @category Bundle - * @package Gdpr + * * @author SuperBrave * @copyright 2018 SuperBrave * @license https://github.com/superbrave/gdpr-bundle/blob/master/LICENSE MIT - * @link https://www.superbrave.nl/ + * + * @see https://www.superbrave.nl/ */ namespace Superbrave\GdprBundle\Tests\Serializer\Normalizer; @@ -46,7 +47,7 @@ public function setUp(): void new DateTimeNormalizer(), $this->normalizer, ], [ - new JsonEncoder() + new JsonEncoder(), ]); $this->normalizer->setNormalizer($this->serializer); @@ -72,7 +73,7 @@ public function testSupportsNormalizationReturnsFalseWhenDataIsNotIterable() */ public function testSupportsNormalizationReturnsTrueWhenDataIsIterable() { - $this->assertTrue($this->normalizer->supportsNormalization(array())); + $this->assertTrue($this->normalizer->supportsNormalization([])); $this->assertTrue($this->normalizer->supportsNormalization(new ArrayCollection())); } @@ -115,12 +116,12 @@ public function testNormalizeThroughJsonSerializer() new ArrayCollection([ new \DateTime('2020/01/01'), new \DateTime('2020/01/01'), - ]) - ] + ]), + ], ]; $this->assertStringEqualsFile( - __DIR__ . '/../../Resources/json/iterable_normalize_result.json', + __DIR__.'/../../Resources/json/iterable_normalize_result.json', $this->serializer->serialize($data, 'json') ); }