Skip to content

Commit 2f76794

Browse files
committed
Fix PHP7 compat
1 parent 113e46d commit 2f76794

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Rules/PHPUnit/DataProviderHelper.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
use function explode;
2727
use function preg_match;
2828
use function sprintf;
29+
use const PHP_VERSION_ID;
2930

3031
class DataProviderHelper
3132
{
@@ -274,7 +275,13 @@ private function parseDataProviderAttribute(Attribute $attribute, ClassReflectio
274275
*/
275276
private function yieldDataProviderAttributes($node, ClassReflection $classReflection): iterable
276277
{
277-
if ($node instanceof ReflectionMethod) {
278+
if (
279+
$node instanceof ReflectionMethod
280+
) {
281+
if (PHP_VERSION_ID < 80000) {
282+
return;
283+
}
284+
278285
foreach ($node->getAttributes('PHPUnit\Framework\Attributes\DataProvider') as $attr) {
279286
$args = $attr->getArguments();
280287
if (count($args) !== 1) {

0 commit comments

Comments
 (0)