Skip to content

Commit 1b2f7bc

Browse files
author
Masiukevich Maksim
committed
code style changes
1 parent c42f870 commit 1b2f7bc

File tree

7 files changed

+18
-58
lines changed

7 files changed

+18
-58
lines changed

phpunit.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,14 @@
1616
<ini name="error_reporting" value="-1"/>
1717
</php>
1818
<testsuites>
19+
20+
<testsuite name="Component: common">
21+
<directory>./vendor/php-service-bus/common/tests/</directory>
22+
</testsuite>
23+
1924
<testsuite name="Message serializer component">
2025
<directory>./tests/</directory>
2126
</testsuite>
27+
2228
</testsuites>
2329
</phpunit>

src/Symfony/Extensions/EmptyDataNormalizer.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,13 @@ final class EmptyDataNormalizer implements NormalizerInterface, DenormalizerInte
2626
*/
2727
private $localStorage = [];
2828

29-
/**
30-
* {@inheritdoc}
31-
*/
29+
3230
public function normalize($object, string $format = null, array $context = []): array
3331
{
3432
return [];
3533
}
3634

3735
/**
38-
* {@inheritdoc}
39-
*
4036
* @throws \ReflectionException
4137
*/
4238
public function supportsNormalization($data, string $format = null): bool
@@ -63,8 +59,6 @@ static function (\ReflectionProperty $property): string
6359
}
6460

6561
/**
66-
* {@inheritdoc}
67-
*
6862
* @throws \ServiceBus\Common\Exceptions\ReflectionApiException
6963
*/
7064
public function denormalize($data, string $type, string $format = null, array $context = []): object
@@ -74,9 +68,6 @@ public function denormalize($data, string $type, string $format = null, array $c
7468
return createWithoutConstructor($type);
7569
}
7670

77-
/**
78-
* {@inheritdoc}
79-
*/
8071
public function supportsDenormalization($data, string $type, string $format = null): bool
8172
{
8273
return empty($data);

src/Symfony/Extensions/PropertyNameConverter.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,11 @@ final class PropertyNameConverter implements NameConverterInterface
2626
*/
2727
private $localStorage = [];
2828

29-
/**
30-
* {@inheritdoc}
31-
*/
3229
public function normalize(string $propertyName): string
3330
{
3431
return $propertyName;
3532
}
3633

37-
/**
38-
* {@inheritdoc}
39-
*/
4034
public function denormalize(string $propertyName): string
4135
{
4236
if (isset($this->localStorage[$propertyName]) === false)

src/Symfony/Extensions/PropertyNormalizerWrapper.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ final class PropertyNormalizerWrapper extends PropertyNormalizer
2727
private $localStorage = [];
2828

2929
/**
30-
* {@inheritdoc}
31-
*
3230
* @param array|bool $allowedAttributes
3331
*
3432
* @throws \ReflectionException
@@ -45,9 +43,6 @@ protected function instantiateObject(
4543
return $reflectionClass->newInstanceWithoutConstructor();
4644
}
4745

48-
/**
49-
* {@inheritdoc}
50-
*/
5146
protected function extractAttributes(object $object, string $format = null, array $context = []): array
5247
{
5348
$class = \get_class($object);
@@ -61,8 +56,6 @@ protected function extractAttributes(object $object, string $format = null, arra
6156
}
6257

6358
/**
64-
* {@inheritdoc}
65-
*
6659
* @throws \Error
6760
*/
6861
protected function getAttributeValue(object $object, string $attribute, string $format = null, array $context = [])
@@ -72,8 +65,6 @@ protected function getAttributeValue(object $object, string $attribute, string $
7265

7366
/**
7467
* @psalm-param mixed $value
75-
*
76-
* {@inheritdoc}
7768
*/
7869
protected function setAttributeValue(object $object, string $attribute, $value, string $format = null, array $context = []): void
7970
{

src/Symfony/Extractor/CombinedExtractor.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,19 @@
2121
*/
2222
final class CombinedExtractor implements PropertyTypeExtractorInterface
2323
{
24-
/** @psalm-var array<string, \Symfony\Component\PropertyInfo\Type[]|null> */
24+
/**
25+
* @psalm-var array<string, \Symfony\Component\PropertyInfo\Type[]|null>
26+
*/
2527
private $localStorage = [];
2628

27-
/** @var PhpDocExtractor */
29+
/**
30+
* @var PhpDocExtractor
31+
*/
2832
private $phpDocExtractor;
2933

30-
/** @var ReflectionExtractor */
34+
/**
35+
* @var ReflectionExtractor
36+
*/
3137
private $reflectionPropertyExtractor;
3238

3339
public function __construct()
@@ -36,9 +42,6 @@ public function __construct()
3642
$this->reflectionPropertyExtractor = new ReflectionExtractor();
3743
}
3844

39-
/**
40-
* {@inheritdoc}
41-
*/
4245
public function getTypes(string $class, string $property, array $context = []): ?array
4346
{
4447
$cacheKey = $class . $property;

src/Symfony/SymfonySerializer.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
use ServiceBus\MessageSerializer\Symfony\Extensions\PropertyNameConverter;
2323
use ServiceBus\MessageSerializer\Symfony\Extensions\PropertyNormalizerWrapper;
2424
use ServiceBus\MessageSerializer\Symfony\Extractor\CombinedExtractor;
25-
use Symfony\Component\PropertyInfo\Extractor\PhpDocExtractor;
2625
use Symfony\Component\Serializer;
2726
use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
2827
use function ServiceBus\Common\jsonDecode;
@@ -45,7 +44,7 @@ final class SymfonySerializer implements MessageEncoder, MessageDecoder
4544
*/
4645
public function __construct(array $normalizers = [])
4746
{
48-
$extractor = \PHP_VERSION_ID >= 70400 ? new CombinedExtractor() : new PhpDocExtractor();
47+
$extractor = new CombinedExtractor();
4948

5049
$defaultNormalizers = [
5150
new DateTimeNormalizer(['datetime_format' => 'c']),

tests/Symfony/SymfonyMessageSerializerTest.php

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php /** @noinspection PhpUnhandledExceptionInspection */
22

33
/**
44
* Messages serializer implementation.
@@ -35,8 +35,6 @@ final class SymfonyMessageSerializerTest extends TestCase
3535
{
3636
/**
3737
* @test
38-
*
39-
* @throws \Throwable
4038
*/
4139
public function emptyClassWithClosedConstructor(): void
4240
{
@@ -51,8 +49,6 @@ public function emptyClassWithClosedConstructor(): void
5149

5250
/**
5351
* @test
54-
*
55-
* @throws \Throwable
5652
*/
5753
public static function classWithClosedConstructor(): void
5854
{
@@ -72,8 +68,6 @@ public static function classWithClosedConstructor(): void
7268

7369
/**
7470
* @test
75-
*
76-
* @throws \Throwable
7771
*/
7872
public function withDateTime(): void
7973
{
@@ -91,8 +85,6 @@ public function withDateTime(): void
9185

9286
/**
9387
* @test
94-
*
95-
* @throws \Throwable
9688
*/
9789
public function wthNullableObjectArgument(): void
9890
{
@@ -125,8 +117,6 @@ public function wthNullableObjectArgument(): void
125117

126118
/**
127119
* @test
128-
*
129-
* @throws \Throwable
130120
*/
131121
public function denormalizeToUnknownClass(): void
132122
{
@@ -139,8 +129,6 @@ public function denormalizeToUnknownClass(): void
139129

140130
/**
141131
* @test
142-
*
143-
* @throws \Throwable
144132
*/
145133
public function withWrongCharset(): void
146134
{
@@ -156,8 +144,6 @@ public function withWrongCharset(): void
156144

157145
/**
158146
* @test
159-
*
160-
* @throws \Throwable
161147
*/
162148
public function successFlow(): void
163149
{
@@ -183,8 +169,6 @@ public function successFlow(): void
183169

184170
/**
185171
* @test
186-
*
187-
* @throws \Throwable
188172
*/
189173
public function successCollection(): void
190174
{
@@ -217,10 +201,6 @@ static function (Author $author): string
217201

218202
/**
219203
* @test
220-
*
221-
* @requires PHP >= 7.4
222-
*
223-
* @throws \Throwable
224204
*/
225205
public function legacyPropertiesSupport(): void
226206
{
@@ -241,10 +221,6 @@ public function legacyPropertiesSupport(): void
241221

242222
/**
243223
* @test
244-
*
245-
* @requires PHP >= 7.4
246-
*
247-
* @throws \Throwable
248224
*/
249225
public function privateMixedPropertiesSupport(): void
250226
{

0 commit comments

Comments
 (0)