8000 Remove obsolete PHP version checks · symfonyaml/symfony@88f557e · GitHub
[go: up one dir, main page]

Skip to content

Commit 88f557e

Browse files
committed
Remove obsolete PHP version checks
1 parent a5e7c8b commit 88f557e

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

src/Symfony/Component/HttpClient/Internal/CurlClientState.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function reset(): void
9595
curl_share_setopt($this->share, \CURLSHOPT_SHARE, \CURL_LOCK_DATA_DNS);
9696
curl_share_setopt($this->share, \CURLSHOPT_SHARE, \CURL_LOCK_DATA_SSL_SESSION);
9797

98-
if (\defined('CURL_LOCK_DATA_CONNECT') && \PHP_VERSION_ID >= 80000) {
98+
if (\defined('CURL_LOCK_DATA_CONNECT')) {
9999
curl_share_setopt($this->share, \CURLSHOPT_SHARE, \CURL_LOCK_DATA_CONNECT);
100100
}
101101
}

src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ public function getWriteInfo(string $class, string $property, array $context = [
364364

365365
if ($reflClass->hasProperty($property) && ($reflClass->getProperty($property)->getModifiers() & $this->propertyReflectionFlags)) {
366366
$reflProperty = $reflClass->getProperty($property);
367-
if (\PHP_VERSION_ID < 80100 || !$reflProperty->isReadOnly()) {
367+
if (!$reflProperty->isReadOnly()) {
368368
return new PropertyWriteInfo(PropertyWriteInfo::TYPE_PROPERTY, $property, $this->getWriteVisiblityForProperty($reflProperty), $reflProperty->isStatic());
369369
}
370370

@@ -578,7 +578,7 @@ private function isAllowedProperty(string $class, string $property, bool $writeA
578578
try {
579579
$reflectionProperty = new \ReflectionProperty($class, $property);
580580

581-
if (\PHP_VERSION_ID >= 80100 && $writeAccessRequired && $reflectionProperty->isReadOnly()) {
581+
if ($writeAccessRequired && $reflectionProperty->isReadOnly()) {
582582
return false;
583583
}
584584

src/Symfony/Component/Validator/Tests/ConstraintValidatorTest.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ class ConstraintValidatorTest extends TestCase
2121
/**
2222
* @dataProvider formatValueProvider
2323
*/
24-
public function testFormatValue($expected, $value, $format = 0)
24+
public function testFormatValue(string $expected, mixed $value, int $format = 0)
2525
{
2626
\Locale::setDefault('en');
2727

2828
$this->assertSame($expected, (new TestFormatValueConstraintValidator())->formatValueProxy($value, $format));
2929
}
3030

31-
public static function formatValueProvider()
31+
public static function formatValueProvider(): array
3232
{
3333
$defaultTimezone = date_default_timezone_get();
3434
date_default_timezone_set('Europe/Moscow'); // GMT+3
@@ -47,12 +47,9 @@ public static function formatValueProvider()
4747
[class_exists(\IntlDateFormatter::class) ? 'Feb 2, 1971, 8:00 AM' : '1971-02-02 08:00:00', $dateTime, ConstraintValidator::PRETTY_DATE],
4848
[class_exists(\IntlDateFormatter::class) ? 'Jan 1, 1970, 6:00 AM' : '1970-01-01 06:00:00', new \DateTimeImmutable('1970-01-01T06:00:00Z'), ConstraintValidator::PRETTY_DATE],
4949
[class_exists(\IntlDateFormatter::class) ? 'Jan 1, 1970, 3:00 PM' : '1970-01-01 15:00:00', (new \DateTimeImmutable('1970-01-01T23:00:00'))->setTimezone(new \DateTimeZone('America/New_York')), ConstraintValidator::PRETTY_DATE],
50+
['FirstCase', TestEnum::FirstCase],
5051
];
5152

52-
if (\PHP_VERSION_ID >= 80100) {
53-
$data[] = ['FirstCase', TestEnum::FirstCase];
54-
}
55-
5653
date_default_timezone_set($defaultTimezone);
5754

5855
return $data;

0 commit comments

Comments
 (0)
0