Skip to content

Commit 8e76f38

Browse files
committed
Fix PHP7 compat
1 parent 113e46d commit 8e76f38

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/Rules/PHPUnit/DataProviderHelper.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@
2424
use function array_merge;
2525
use function count;
2626
use function explode;
27+
use function method_exists;
2728
use function preg_match;
2829
use function sprintf;
30+
use const PHP_VERSION_ID;
2931

3032
class DataProviderHelper
3133
{
@@ -274,7 +276,13 @@ private function parseDataProviderAttribute(Attribute $attribute, ClassReflectio
274276
*/
275277
private function yieldDataProviderAttributes($node, ClassReflection $classReflection): iterable
276278
{
277-
if ($node instanceof ReflectionMethod) {
279+
if (
280+
$node instanceof ReflectionMethod
281+
) {
282+
if (PHP_VERSION_ID < 80000) {
283+
return;
284+
}
285+
278286
foreach ($node->getAttributes('PHPUnit\Framework\Attributes\DataProvider') as $attr) {
279287
$args = $attr->getArguments();
280288
if (count($args) !== 1) {

0 commit comments

Comments
 (0)