Skip to content

Commit 649cead

Browse files
committed
Add test for unset.
1 parent b1d1df9 commit 649cead

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

tests/PHPStan/Rules/Properties/MissingReadOnlyPropertyAssignRuleTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function testBug13856(): void
5252
$this->analyse([__DIR__ . '/data/bug-13856.php'], [
5353
[
5454
'Readonly property Bug13856\foo2::$store is already assigned.',
55-
27,
55+
28,
5656
],
5757
]);
5858
}

tests/PHPStan/Rules/Properties/data/bug-13856.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public function __construct()
1313
{
1414
$this->store = new SplObjectStorage();
1515
$this->store[(object) ['foo' => 'bar']] = true;
16+
unset($this->store[(object) ['foo' => 'bar']]);
1617
}
1718
}
1819

0 commit comments

Comments
 (0)