Skip to content

Commit 8f559bc

Browse files
Add test
1 parent ee69212 commit 8f559bc

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/Rules/Comparison/ExpressionDependsOnThisHelper.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace PHPStan\Rules\Comparison;
44

55
use PhpParser\Node\Expr;
6+
use function in_array;
67

78
final class ExpressionDependsOnThisHelper
89
{
@@ -27,7 +28,7 @@ public static function isExpressionDependentOnThis(Expr $expr): bool
2728
}
2829

2930
$className = $expr->class->toString();
30-
return \in_array($className, ['self', 'static', 'parent'], true);
31+
return in_array($className, ['self', 'static', 'parent'], true);
3132
}
3233

3334
return false;

tests/PHPStan/Rules/Arrays/InvalidKeyInArrayDimFetchRuleTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,11 @@ public function testBug12273(): void
144144
]);
145145
}
146146

147+
public function testBug12798(): void
148+
{
149+
$this->analyse([__DIR__ . '/../Comparison/data/bug-12798.php'], []);
150+
}
151+
147152
public function testBug12981(): void
148153
{
149154
$this->analyse([__DIR__ . '/data/bug-12981.php'], [

0 commit comments

Comments
 (0)