File tree Expand file tree Collapse file tree 3 files changed +44
-1
lines changed
tests/PHPStan/Rules/PhpDoc Expand file tree Collapse file tree 3 files changed +44
-1
lines changed Original file line number Diff line number Diff line change @@ -23,11 +23,11 @@ class InvalidPHPStanDocTagRule implements Rule
23
23
'@phpstan-param ' ,
24
24
'@phpstan-param-out ' ,
25
25
'@phpstan-var ' ,
26
- '@phpstan-template ' ,
27
26
'@phpstan-extends ' ,
28
27
'@phpstan-implements ' ,
29
28
'@phpstan-use ' ,
30
29
'@phpstan-template ' ,
30
+ '@phpstan-template-contravariant ' ,
31
31
'@phpstan-template-covariant ' ,
32
32
'@phpstan-return ' ,
33
33
'@phpstan-throws ' ,
@@ -36,6 +36,7 @@ class InvalidPHPStanDocTagRule implements Rule
36
36
'@phpstan-method ' ,
37
37
'@phpstan-pure ' ,
38
38
'@phpstan-impure ' ,
39
+ '@phpstan-immutable ' ,
39
40
'@phpstan-type ' ,
40
41
'@phpstan-import-type ' ,
41
42
'@phpstan-property ' ,
@@ -47,6 +48,9 @@ class InvalidPHPStanDocTagRule implements Rule
47
48
'@phpstan-assert-if-false ' ,
48
49
'@phpstan-self-out ' ,
49
50
'@phpstan-this-out ' ,
51
+ '@phpstan-allow-private-mutation ' ,
52
+ '@phpstan-readonly ' ,
53
+ '@phpstan-readonly-allow-private-mutation ' ,
50
54
];
51
55
52
56
public function __construct (private Lexer $ phpDocLexer , private PhpDocParser $ phpDocParser )
Original file line number Diff line number Diff line change @@ -35,4 +35,9 @@ public function testRule(): void
35
35
]);
36
36
}
37
37
38
+ public function testBug8697 (): void
39
+ {
40
+ $ this ->analyse ([__DIR__ . '/data/bug-8697.php ' ], []);
41
+ }
42
+
38
43
}
Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types = 1 );
2
+
3
+ /**
4
+ * @phpstan-immutable
5
+ * @phpstan-template-contravariant T
6
+ */
7
+ class Bug8697
8
+ {
9
+
10
+ /**
11
+ * @phpstan-readonly
12
+ * @phpstan-allow-private-mutation
13
+ * @phpstan-var mixed
14
+ */
15
+ public $ p1 ;
16
+
17
+ /**
18
+ * @phpstan-readonly-allow-private-mutation
19
+ * @phpstan-var mixed
20
+ * @phpstan-throws LogicException
21
+ * @phpstan-return void
22
+ */
23
+ public $ p2 ;
24
+
25
+ /**
26
+ * @phpstan-param mixed $v
27
+ * @phpstan-param-out 1 $v
28
+ */
29
+ public function f (&$ v )
30
+ {
31
+ $ v = 1 ;
32
+ }
33
+
34
+ }
You can’t perform that action at this time.
0 commit comments