diff --git a/src/Symfony/Component/HttpClient/Internal/CurlClientState.php b/src/Symfony/Component/HttpClient/Internal/CurlClientState.php index bcf1f92ab4840..ee0bafc11bd1f 100644 --- a/src/Symfony/Component/HttpClient/Internal/CurlClientState.php +++ b/src/Symfony/Component/HttpClient/Internal/CurlClientState.php @@ -95,7 +95,7 @@ public function reset(): void curl_share_setopt($this->share, \CURLSHOPT_SHARE, \CURL_LOCK_DATA_DNS); curl_share_setopt($this->share, \CURLSHOPT_SHARE, \CURL_LOCK_DATA_SSL_SESSION); - if (\defined('CURL_LOCK_DATA_CONNECT') && \PHP_VERSION_ID >= 80000) { + if (\defined('CURL_LOCK_DATA_CONNECT')) { curl_share_setopt($this->share, \CURLSHOPT_SHARE, \CURL_LOCK_DATA_CONNECT); } } diff --git a/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php b/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php index ff86ef859d53d..e6069e0bffe46 100644 --- a/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php +++ b/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php @@ -364,7 +364,7 @@ public function getWriteInfo(string $class, string $property, array $context = [ if ($reflClass->hasProperty($property) && ($reflClass->getProperty($property)->getModifiers() & $this->propertyReflectionFlags)) { $reflProperty = $reflClass->getProperty($property); - if (\PHP_VERSION_ID < 80100 || !$reflProperty->isReadOnly()) { + if (!$reflProperty->isReadOnly()) { return new PropertyWriteInfo(PropertyWriteInfo::TYPE_PROPERTY, $property, $this->getWriteVisiblityForProperty($reflProperty), $reflProperty->isStatic()); } @@ -578,7 +578,7 @@ private function isAllowedProperty(string $class, string $property, bool $writeA try { $reflectionProperty = new \ReflectionProperty($class, $property); - if (\PHP_VERSION_ID >= 80100 && $writeAccessRequired && $reflectionProperty->isReadOnly()) { + if ($writeAccessRequired && $reflectionProperty->isReadOnly()) { return false; } diff --git a/src/Symfony/Component/Validator/Tests/ConstraintValidatorTest.php b/src/Symfony/Component/Validator/Tests/ConstraintValidatorTest.php index 91e67cadec67e..493778183d103 100644 --- a/src/Symfony/Component/Validator/Tests/ConstraintValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/ConstraintValidatorTest.php @@ -21,14 +21,14 @@ class ConstraintValidatorTest extends TestCase /** * @dataProvider formatValueProvider */ - public function testFormatValue($expected, $value, $format = 0) + public function testFormatValue(string $expected, mixed $value, int $format = 0) { \Locale::setDefault('en'); $this->assertSame($expected, (new TestFormatValueConstraintValidator())->formatValueProxy($value, $format)); } - public static function formatValueProvider() + public static function formatValueProvider(): array { $defaultTimezone = date_default_timezone_get(); date_default_timezone_set('Europe/Moscow'); // GMT+3 @@ -47,12 +47,9 @@ public static function formatValueProvider() [class_exists(\IntlDateFormatter::class) ? 'Feb 2, 1971, 8:00 AM' : '1971-02-02 08:00:00', $dateTime, ConstraintValidator::PRETTY_DATE], [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], [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], + ['FirstCase', TestEnum::FirstCase], ]; - if (\PHP_VERSION_ID >= 80100) { - $data[] = ['FirstCase', TestEnum::FirstCase]; - } - date_default_timezone_set($defaultTimezone); return $data;