Skip to content

Commit 0c185ae

Browse files
authored
EnforceReadonlyPublicPropertyRule: test for readonly class (#69)
* EnforceReadonlyPublicPropertyRule: test for readonly class * bump parser and phpstan to ensure readonly class support
1 parent ab72ba8 commit 0c185ae

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
],
1111
"require": {
1212
"php": "^7.4 || ^8.0",
13-
"nikic/php-parser": "^4.13.2",
14-
"phpstan/phpstan": "^1.8.1"
13+
"nikic/php-parser": "^4.14.0",
14+
"phpstan/phpstan": "^1.8.7"
1515
},
1616
"require-dev": {
1717
"editorconfig-checker/editorconfig-checker": "^10.3.0",

tests/Rule/data/EnforceReadonlyPublicPropertyRule/code.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,15 @@ class MyClass {
2828

2929
}
3030

31+
readonly class MyReadonlyClass {
32+
33+
public ?int $foo;
34+
35+
public readonly int $bar;
36+
37+
protected int $baz;
38+
39+
private int $bag;
40+
41+
}
42+

0 commit comments

Comments
 (0)