8000 Use PHP_VERSION_ID instead of method_exists · symfony/symfony@4fdf296 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4fdf296

Browse files
committed
Use PHP_VERSION_ID instead of method_exists
Psalm does not matter. method_exists may introduce some unneeded overhead.
1 parent b482f1b commit 4fdf296

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -625,11 +625,8 @@ private function isAllowedProperty(string $class, string $property, bool $writeA
625625
return false;
626626
}
627627

628-
if (
629-
$writeAccessRequired
630-
&& method_exists($reflectionProperty, 'isVirtual')
631-
&& method_exists($reflectionProperty, 'hasHook')
632-
&& enum_exists('PropertyHookType')
628+
if (\PHP_VERSION_ID >= 80400
629+
&& $writeAccessRequired
633630
&& $reflectionProperty->isVirtual()
634631
&& !$reflectionProperty->hasHook(\PropertyHookType::Set)
635632
) {

0 commit comments

Comments
 (0)
0