Skip to content

Commit 21f8587

Browse files
committed
Rollback of the minimum php version to 7.3
1 parent 2704b02 commit 21f8587

File tree

10 files changed

+111
-86
lines changed

10 files changed

+111
-86
lines changed

.travis.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
language: php
22

33
php:
4+
- 7.3
45
- 7.4snapshot
56

67
cache:
@@ -19,10 +20,9 @@ install:
1920

2021
script:
2122
- ./vendor/bin/phpunit --configuration ./phpunit.xml --coverage-clover=coverage.clover
22-
- ./vendor/bin/psalm --config=psalm.xml
23-
- ./vendor/bin/phpstan analyse src --level 7
24-
- ./vendor/bin/php-cs-fixer fix --allow-risky=yes --dry-run
23+
- if [ "$TRAVIS_PHP_VERSION" == "7.4snapshot"]; then ./vendor/bin/psalm --config=psalm.xml; fi
24+
- if [ "$TRAVIS_PHP_VERSION" == "7.4snapshot"]; then ./vendor/bin/php-cs-fixer fix --allow-risky=yes --dry-run; fi
2525

2626
after_script:
27-
- wget -c -nc --retry-connrefused --tries=0 https://scrutinizer-ci.com/ocular.phar
28-
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
27+
- if [ "$TRAVIS_PHP_VERSION" == "7.4snapshot"]; then wget -c -nc --retry-connrefused --tries=0 https://scrutinizer-ci.com/ocular.phar; fi
28+
- if [ "$TRAVIS_PHP_VERSION" == "7.4snapshot"]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
}
2929
},
3030
"require": {
31-
"php": ">=7.4",
31+
"php": ">=7.3",
3232
"ext-json": "*",
3333
"ext-iconv": "*",
3434
"php-service-bus/common": "v4.0.*",

composer.lock

Lines changed: 19 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpunit.xml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
3-
<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
4-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/7.0/phpunit.xsd"
2+
<phpunit bootstrap="vendor/autoload.php"
63
backupGlobals="false"
4+
backupStaticAttributes="false"
5+
beStrictAboutTestsThatDoNotTestAnything="false"
76
colors="true"
8-
bootstrap="vendor/autoload.php"
7+
verbose="true"
8+
convertErrorsToExceptions="true"
9+
convertNoticesToExceptions="true"
10+
convertWarningsToExceptions="true"
911
failOnRisky="true"
1012
failOnWarning="true"
11-
beStrictAboutTestsThatDoNotTestAnything="false">
13+
stopOnFailure="false">
1214
<php>
1315
<ini name="error_reporting" value="-1"/>
1416
</php>

src/Symfony/Extensions/EmptyDataNormalizer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ final class EmptyDataNormalizer implements NormalizerInterface, DenormalizerInte
2424
/**
2525
* @psalm-var array<string, array<array-key, string>>
2626
*/
27-
private array $localStorage = [];
27+
private $localStorage = [];
2828

2929
/**
3030
* {@inheritdoc}
@@ -41,11 +41,11 @@ public function normalize($object, string $format = null, array $context = [])
4141
*/
4242
public function supportsNormalization($data, string $format = null): bool
4343
{
44-
if (true === \is_object($data))
44+
if ( \is_object($data) === true)
4545
{
4646
$class = \get_class($data);
4747

48-
if (false === isset($this->localStorage[$class]))
48+
if (isset($this->localStorage[$class]) === false)
4949
{
5050
$this->localStorage[$class] = \array_map(
5151
static function (\ReflectionProperty $property): string

src/Symfony/Extensions/PropertyNameConverter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ final class PropertyNameConverter implements NameConverterInterface
2424
*
2525
* @psalm-var array<string, string>
2626
*/
27-
private array $localStorage;
27+
private $localStorage;
2828

2929
/**
3030
* {@inheritdoc}
@@ -39,7 +39,7 @@ public function normalize(string $propertyName): string
3939
*/
4040
public function denormalize(string $propertyName): string
4141
{
42-
if (false === isset($this->localStorage[$propertyName]))
42+
if ( isset($this->localStorage[$propertyName]) === false)
4343
{
4444
$joinedString = \preg_replace_callback(
4545
'/_(.?)/',

src/Symfony/Extensions/PropertyNormalizerWrapper.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ final class PropertyNormalizerWrapper extends PropertyNormalizer
2424
/**
2525
* @psalm-var array<string, array<array-key, string>>
2626
*/
27-
private array $localStorage = [];
27+
private $localStorage = [];
2828

2929
/**
3030
* {@inheritdoc}
@@ -38,7 +38,8 @@ protected function instantiateObject(
3838
\ReflectionClass $reflectionClass,
3939
$allowedAttributes,
4040
string $format = null
41-
): object {
41+
): object
42+
{
4243
return $reflectionClass->newInstanceWithoutConstructor();
4344
}
4445

@@ -49,7 +50,7 @@ protected function extractAttributes(object $object, string $format = null, arra
4950
{
5051
$class = \get_class($object);
5152

52-
if (false === \array_key_exists($class, $this->localStorage))
53+
if(\array_key_exists($class, $this->localStorage) === false)
5354
{
5455
$this->localStorage[$class] = parent::extractAttributes($object, $format, $context);
5556
}
@@ -64,7 +65,7 @@ protected function extractAttributes(object $object, string $format = null, arra
6465
*/
6566
protected function getAttributeValue(object $object, string $attribute, string $format = null, array $context = [])
6667
{
67-
if (true === isset($object->{$attribute}))
68+
if(isset($object->{$attribute}) === true)
6869
{
6970
return $object->{$attribute};
7071
}
@@ -73,9 +74,9 @@ protected function getAttributeValue(object $object, string $attribute, string $
7374
{
7475
return parent::getAttributeValue($object, $attribute, $format, $context);
7576
}
76-
catch (\Error $error)
77+
catch(\Error $error)
7778
{
78-
if (\strpos($error->getMessage(), 'must not be accessed before initialization') !== false)
79+
if(\strpos($error->getMessage(), 'must not be accessed before initialization') !== false)
7980
{
8081
return null;
8182
}
@@ -91,7 +92,7 @@ protected function getAttributeValue(object $object, string $attribute, string $
9192
*/
9293
protected function setAttributeValue(object $object, string $attribute, $value, string $format = null, array $context = []): void
9394
{
94-
if (true === isset($object->{$attribute}))
95+
if(isset($object->{$attribute}) === true)
9596
{
9697
$object->{$attribute} = $value;
9798

src/Symfony/Extractor/FailOverExtractor.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ final class FailOverExtractor implements PropertyTypeExtractorInterface
2323
/**
2424
* @psalm-var array<string, \Symfony\Component\PropertyInfo\Type[]|null>
2525
*/
26-
private array $localStorage;
26+
private $localStorage = [];
2727

2828
/**
2929
* @var PropertyTypeExtractorInterface[]
3030
*/
31-
private array $extractors;
31+
private $extractors;
3232

3333
public function __construct()
3434
{
@@ -42,15 +42,15 @@ public function getTypes(string $class, string $property, array $context = []):
4242
{
4343
$cacheKey = \sha1($class . $property);
4444

45-
if (\array_key_exists($cacheKey, $this->localStorage) === false)
45+
if(\array_key_exists($cacheKey, $this->localStorage) === false)
4646
{
4747
$this->localStorage[$cacheKey] = null;
4848

49-
foreach ($this->extractors as $extractor)
49+
foreach($this->extractors as $extractor)
5050
{
5151
$types = $extractor->getTypes($class, $property, $context);
5252

53-
if (null !== $types)
53+
if(null !== $types)
5454
{
5555
$this->localStorage[$cacheKey] = $types;
5656

src/Symfony/SymfonyMessageSerializer.php

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,17 @@ final class SymfonyMessageSerializer implements MessageEncoder, MessageDecoder
3434
{
3535
/**
3636
* Symfony normalizer\denormalizer.
37+
*
38+
* @var SymfonySerializer\Serializer
3739
*/
38-
private SymfonySerializer\Serializer $normalizer;
40+
private $normalizer;
3941

4042
/**
4143
* Serializer implementation.
44+
*
45+
* @var Serializer
4246
*/
43-
private Serializer $serializer;
47+
private $serializer;
4448

4549
/**
4650
* @param SymfonySerializer\Normalizer\DenormalizerInterface[]|SymfonySerializer\Normalizer\NormalizerInterface[] $normalizers
@@ -72,7 +76,7 @@ public function encode(object $message): string
7276

7377
return $this->serializer->serialize($data);
7478
}
75-
catch (\Throwable $throwable)
79+
catch(\Throwable $throwable)
7680
{
7781
throw new EncodeMessageFailed($throwable->getMessage(), (int) $throwable->getCode(), $throwable);
7882
}
@@ -95,7 +99,7 @@ public function decode(string $serializedMessage): object
9599

96100
return $object;
97101
}
98-
catch (\Throwable $throwable)
102+
catch(\Throwable $throwable)
99103
{
100104
throw new DecodeMessageFailed($throwable->getMessage(), (int) $throwable->getCode(), $throwable);
101105
}
@@ -116,7 +120,7 @@ public function denormalize(array $payload, string $class): object
116120

117121
return $object;
118122
}
119-
catch (\Throwable $throwable)
123+
catch(\Throwable $throwable)
120124
{
121125
throw new DenormalizeFailed($throwable->getMessage(), (int) $throwable->getCode(), $throwable);
122126
}
@@ -131,7 +135,7 @@ public function normalize(object $message): array
131135
{
132136
$data = $this->normalizer->normalize($message);
133137

134-
if (true === \is_array($data))
138+
if(\is_array($data) === true)
135139
{
136140
/** @psalm-var array<string, mixed> $data */
137141

@@ -148,7 +152,7 @@ public function normalize(object $message): array
148152
);
149153
// @codeCoverageIgnoreEnd
150154
}
151-
catch (\Throwable $throwable)
155+
catch(\Throwable $throwable)
152156
{
153157
throw new NormalizationFailed($throwable->getMessage(), (int) $throwable->getCode(), $throwable);
154158
}
@@ -162,10 +166,11 @@ public function normalize(object $message): array
162166
private static function validateUnserializedData(array $data): void
163167
{
164168
/** Let's check if there are mandatory fields */
165-
if (
166-
false === isset($data['namespace']) ||
167-
false === isset($data['message'])
168-
) {
169+
if(
170+
isset($data['namespace']) === false ||
171+
isset($data['message']) === false
172+
)
173+
{
169174
throw new \UnexpectedValueException(
170175
'The serialized data must contains a "namespace" field (indicates the message class) and "message" (indicates the message parameters)'
171176
);
@@ -176,7 +181,7 @@ private static function validateUnserializedData(array $data): void
176181
*
177182
* @psalm-suppress DocblockTypeContradiction
178183
*/
179-
if ('' === $data['namespace'] || false === \class_exists((string) $data['namespace']))
184+
if($data['namespace'] === '' || \class_exists((string) $data['namespace']) === false)
180185
{
181186
throw new \UnexpectedValueException(
182187
\sprintf('Class "%s" not found', $data['namespace'])

0 commit comments

Comments
 (0)