Skip to content

Commit 7d766ae

Browse files
committed
Fix build
1 parent db27c1f commit 7d766ae

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"keywords": ["static analysis"],
99
"require": {
1010
"php": "^7.4 || ^8.0",
11-
"phpstan/phpstan": "^2.1.32"
11+
"phpstan/phpstan": "^2.1.41"
1212
},
1313
"conflict": {
1414
"phpunit/phpunit": "<7.0"

src/Rules/PHPUnit/AnnotationHelper.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,10 @@ public function processDocComment(Doc $docComment): array
4343
foreach ($docCommentLines as $docCommentLine) {
4444
// These annotations can't be retrieved using the getResolvedPhpDoc method on the FileTypeMapper as they are not present when they are invalid
4545
$annotation = preg_match('/(?<annotation>@(?<property>[a-zA-Z]+)(?<whitespace>\s*)(?<value>.*))/', $docCommentLine, $matches);
46-
if ($annotation === false) {
46+
if ($annotation === false || $matches === []) {
4747
continue; // Line without annotation
4848
}
4949

50-
if (array_key_exists('property', $matches) === false || array_key_exists('whitespace', $matches) === false || array_key_exists('annotation', $matches) === false) {
51-
continue;
52-
}
53-
5450
if (!in_array($matches['property'], self::ANNOTATIONS_WITH_PARAMS, true) || $matches['whitespace'] !== '') {
5551
continue;
5652
}

0 commit comments

Comments
 (0)