Skip to content

Commit 068be33

Browse files
committed
Test AccessPropertiesInAssignRule private(set) with array append
1 parent a83c3dc commit 068be33

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

tests/PHPStan/Rules/Properties/AccessPropertiesInAssignRuleTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ public function testAsymmetricVisibility(): void
157157
'Assign to private(set) property WriteAsymmetricVisibility\ReadonlyProps::$c.',
158158
72,
159159
],
160+
[
161+
'Assign to private(set) property WriteAsymmetricVisibility\ArrayProp::$a.',
162+
83,
163+
],
160164
]);
161165
}
162166

tests/PHPStan/Rules/Properties/data/write-asymmetric-visibility.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,14 @@ function (ReadonlyProps $foo): void {
7171
$foo->b = 1;
7272
$foo->c = 1;
7373
};
74+
75+
class ArrayProp
76+
{
77+
78+
public private(set) array $a = [];
79+
80+
}
81+
82+
function (ArrayProp $foo): void {
83+
$foo->a[] = 1;
84+
};

0 commit comments

Comments
 (0)