Skip to content

Commit

Permalink
use class_exists instead of interface_exists, it's the closest approx…
Browse files Browse the repository at this point in the history
…imation
  • Loading branch information
orklah committed Jan 16, 2022
1 parent 6d23c17 commit f8fdedd
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,9 @@ private static function functionEvaluatesToTrue(
$string_value = (string) $function->getArgs()[0]->value->class->getAttribute('resolvedName');
}

if ($string_value && interface_exists($string_value)) {
// We're using class_exists here because enum_exists doesn't exist on old versions of PHP
// Not sure what happens if we try to autoload or reflect on an enum on an old version of PHP though...
if ($string_value && class_exists($string_value)) {
$reflection_class = new ReflectionClass($string_value);

if ($reflection_class->getFileName() !== $file_path) {
Expand Down

0 comments on commit f8fdedd

Please sign in to comment.