Skip to content

Commit 2e07610

Browse files
committed
Check isFirstClassCallable before accessing getArgs
1 parent 22c6949 commit 2e07610

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

src/Rules/PHPUnit/AssertEqualsIsDiscouragedRule.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ public function processNode(Node $node, Scope $scope): array
3131
return [];
3232
}
3333

34+
if ($node->isFirstClassCallable()) {
35+
return [];
36+
}
37+
3438
if (count($node->getArgs()) < 2) {
3539
return [];
3640
}

src/Rules/PHPUnit/AssertSameBooleanExpectedRule.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ public function processNode(Node $node, Scope $scope): array
2727
return [];
2828
}
2929

30+
if ($node->isFirstClassCallable()) {
31+
return [];
32+
}
33+
3034
if (count($node->getArgs()) < 2) {
3135
return [];
3236
}

src/Rules/PHPUnit/AssertSameNullExpectedRule.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ public function processNode(Node $node, Scope $scope): array
2727
return [];
2828
}
2929

30+
if ($node->isFirstClassCallable()) {
31+
return [];
32+
}
33+
3034
if (count($node->getArgs()) < 2) {
3135
return [];
3236
}

src/Rules/PHPUnit/AssertSameWithCountRule.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ public function processNode(Node $node, Scope $scope): array
2828
return [];
2929
}
3030

31+
if ($node->isFirstClassCallable()) {
32+
return [];
33+
}
34+
3135
if (count($node->getArgs()) < 2) {
3236
return [];
3337
}

0 commit comments

Comments
 (0)