Skip to content

Commit 21199b3

Browse files
authored
swap array_any to traditional foreach
1 parent 3ede29a commit 21199b3

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/NodeAnalyzer/TestsNodeAnalyzer.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,10 @@ public function isTestClassMethod(ClassMethod $classMethod): bool
5959
}
6060

6161
foreach ($classMethod->getAttrGroups() as $attrGroup) {
62-
$hasTestAttribute = array_any(
63-
$attrGroup->attrs,
64-
static fn($attribute): bool => $attribute->name->toString() === 'PHPUnit\\Framework\\Attributes\\Test'
65-
);
66-
if ($hasTestAttribute) {
67-
return \true;
62+
foreach ($attrGroup->attrs as $attribute) {
63+
if($attribute->name->toString() === 'PHPUnit\\Framework\\Attributes\\Test'){
64+
return true;
65+
}
6866
}
6967
}
7068

0 commit comments

Comments
 (0)