Skip to content

Commit

Permalink
Avoid a deprecation notice when running tests with PHP 8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
mpdude committed Feb 27, 2024
1 parent bb27e88 commit 6a2ac89
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,13 @@ protected function removeAnnotationLoaderFromRegistry(\Closure $loader)
unset($activeLoaders[$index]);
}
}
$annotationLoaderProperty->setValue(array_values($activeLoaders));
// Work around this issue https://www.php.net/manual/en/reflectionclass.setstaticpropertyvalue.php#114740
// which seems to be fixed as of PHP 7.4.
if (PHP_VERSION >= 70400) {
$reflection->setStaticPropertyValue('loaders', array_values($activeLoaders));
} else {
$annotationLoaderProperty->setValue(array_values($activeLoaders));
}
}

/**
Expand Down

0 comments on commit 6a2ac89

Please sign in to comment.