Skip to content

Commit 149b829

Browse files
committed
Update UnsetRuleTest.php
1 parent b93676f commit 149b829

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

tests/PHPStan/Rules/Variables/UnsetRuleTest.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,18 @@ public function testBug2752(): void
6161

6262
public function testBug4289(): void
6363
{
64-
if (PHP_VERSION_ID < 80400) {
65-
$this->analyse([__DIR__ . '/data/bug-4289.php'], []);
66-
} else {
67-
$this->analyse([__DIR__ . '/data/bug-4289.php'], [
64+
$errors = [];
65+
66+
if (PHP_VERSION_ID >= 80400) {
67+
$errors = [
6868
[
69-
'Cannot unset Bug4289\BaseClass::$fields property which might get hooked in subclass.',
69+
'Cannot unset property Bug4289\BaseClass::$fields because it might have hooks in a subclass.',
7070
25,
7171
],
72-
]);
72+
];
7373
}
74+
75+
$this->analyse([__DIR__ . '/data/bug-4289.php'], $errors);
7476
}
7577

7678
public function testBug5223(): void
@@ -112,7 +114,7 @@ public function testBug12421(): void
112114
$errors = [];
113115
if (PHP_VERSION_ID >= 80400) {
114116
$errors[] = [
115-
'Cannot unset Bug12421\RegularProperty::$y property which might get hooked in subclass.',
117+
'Cannot unset property Bug12421\RegularProperty::$y because it might have hooks in a subclass.',
116118
7,
117119
];
118120
}
@@ -171,7 +173,7 @@ public function testUnsetHookedProperty(): void
171173
10,
172174
],
173175
[
174-
'Cannot unset UnsetHookedProperty\NonFinalClass::$publicProperty property which might get hooked in subclass.',
176+
'Cannot unset property UnsetHookedProperty\NonFinalClass::$publicProperty because it might have hooks in a subclass.',
175177
13,
176178
],
177179
]);

0 commit comments

Comments
 (0)