@@ -7,15 +7,13 @@ class RedundantDocCommentTagInspectionTest : BaseInspectionTest() {
7
7
@Test
8
8
fun testRedundantReturnType () {
9
9
assert (
10
- RedundantDocCommentTagInspection (),
11
- """
10
+ RedundantDocCommentTagInspection (), """
12
11
<?php
13
12
/**
14
13
*<warning descr="Redundant PhpDoc tag">@return void</warning>
15
14
*/
16
15
function show(string ${' $' } message):void {}
17
- """ ,
18
- """
16
+ """ , """
19
17
<?php
20
18
function show(string ${' $' } message):void {}
21
19
"""
@@ -25,16 +23,14 @@ class RedundantDocCommentTagInspectionTest : BaseInspectionTest() {
25
23
@Test
26
24
fun testRedundantReturnTypeWithNonEmptyComment () {
27
25
assert (
28
- RedundantDocCommentTagInspection (),
29
- """
26
+ RedundantDocCommentTagInspection (), """
30
27
<?php
31
28
/**
32
29
* Hello world
33
30
*<warning descr="Redundant PhpDoc tag">@return void</warning>
34
31
*/
35
32
function show(string ${' $' } message):void {}
36
- """ ,
37
- """
33
+ """ , """
38
34
<?php
39
35
/**
40
36
* Hello world
@@ -47,16 +43,14 @@ class RedundantDocCommentTagInspectionTest : BaseInspectionTest() {
47
43
@Test
48
44
fun testRedundantParameterTag () {
49
45
assert (
50
- RedundantDocCommentTagInspection (),
51
- """
46
+ RedundantDocCommentTagInspection (), """
52
47
<?php
53
48
/**
54
49
*<warning descr="Redundant PhpDoc tag">@param string ${' $' } message</warning>
55
50
* @param string ${' $' } test
56
51
*/
57
52
function show(int ${' $' } a, string ${' $' } message):void {}
58
- """ ,
59
- """
53
+ """ , """
60
54
<?php
61
55
/**
62
56
* @param string ${' $' } test
@@ -69,8 +63,7 @@ class RedundantDocCommentTagInspectionTest : BaseInspectionTest() {
69
63
@Test
70
64
fun testRedundantParameterTagWithClassFQN () {
71
65
assert (
72
- RedundantDocCommentTagInspection (),
73
- """
66
+ RedundantDocCommentTagInspection (), """
74
67
<?php
75
68
class A{
76
69
/**
@@ -86,8 +79,7 @@ class RedundantDocCommentTagInspectionTest : BaseInspectionTest() {
86
79
@Test
87
80
fun testReturnMultipleTypes () {
88
81
assert (
89
- RedundantDocCommentTagInspection (),
90
- """
82
+ RedundantDocCommentTagInspection (), """
91
83
<?php
92
84
/**
93
85
* @return \Generator|string[]
@@ -100,8 +92,7 @@ class RedundantDocCommentTagInspectionTest : BaseInspectionTest() {
100
92
@Test
101
93
fun testCheckEmptyTag () {
102
94
assert (
103
- RedundantDocCommentTagInspection (),
104
- """
95
+ RedundantDocCommentTagInspection (), """
105
96
<?php
106
97
/**
107
98
* @return
@@ -114,8 +105,7 @@ class RedundantDocCommentTagInspectionTest : BaseInspectionTest() {
114
105
@Test
115
106
fun testCheckNullableReturnType () {
116
107
assert (
117
- RedundantDocCommentTagInspection (),
118
- """
108
+ RedundantDocCommentTagInspection (), """
119
109
<?php
120
110
/**
121
111
*<warning descr="Redundant PhpDoc tag">@return bool|null</warning>
@@ -128,8 +118,7 @@ class RedundantDocCommentTagInspectionTest : BaseInspectionTest() {
128
118
@Test
129
119
fun testCheckNullableParameterType () {
130
120
assert (
131
- RedundantDocCommentTagInspection (),
132
- """
121
+ RedundantDocCommentTagInspection (), """
133
122
<?php
134
123
/**
135
124
*<warning descr="Redundant PhpDoc tag">@param stdClass|null ${' $' } o</warning>
@@ -142,8 +131,7 @@ class RedundantDocCommentTagInspectionTest : BaseInspectionTest() {
142
131
@Test
143
132
fun testRedundantFieldTag () {
144
133
assert (
145
- RedundantDocCommentTagInspection (),
146
- """
134
+ RedundantDocCommentTagInspection (), """
147
135
<?php
148
136
class PhpClean {
149
137
/**
@@ -158,8 +146,7 @@ class RedundantDocCommentTagInspectionTest : BaseInspectionTest() {
158
146
@Test
159
147
fun testFieldTagWithClassFQN () {
160
148
assert (
161
- RedundantDocCommentTagInspection (),
162
- """
149
+ RedundantDocCommentTagInspection (), """
163
150
<?php
164
151
class PhpClean {
165
152
/**
@@ -171,11 +158,28 @@ class RedundantDocCommentTagInspectionTest : BaseInspectionTest() {
171
158
)
172
159
}
173
160
161
+ @Test
162
+ fun testIgnoreArrayShapeTags () {
163
+ assert (
164
+ RedundantDocCommentTagInspection (), """
165
+ <?php
166
+ class PhpClean {
167
+ /**
168
+ * @param array{id: int, name: string} ${' $' } variable
169
+ * @return array{id: int, name: string}
170
+ */
171
+ function example(array ${' $' } variable): array{
172
+ return ['id'=>123, 'name'=>'test'];
173
+ }
174
+ }
175
+ """
176
+ )
177
+ }
178
+
174
179
@Test
175
180
fun testFieldTagWithMultipleTypes () {
176
181
assert (
177
- RedundantDocCommentTagInspection (),
178
- """
182
+ RedundantDocCommentTagInspection (), """
179
183
<?php
180
184
class PhpClean {
181
185
/**
@@ -190,8 +194,7 @@ class RedundantDocCommentTagInspectionTest : BaseInspectionTest() {
190
194
@Test
191
195
fun testFieldWithEmptyTag () {
192
196
assert (
193
- RedundantDocCommentTagInspection (),
194
- """
197
+ RedundantDocCommentTagInspection (), """
195
198
<?php
196
199
class PhpClean {
197
200
/**
@@ -206,8 +209,7 @@ class RedundantDocCommentTagInspectionTest : BaseInspectionTest() {
206
209
@Test
207
210
fun testCheckNullableFieldType () {
208
211
assert (
209
- RedundantDocCommentTagInspection (),
210
- """
212
+ RedundantDocCommentTagInspection (), """
211
213
<?php
212
214
class PhpClean {
213
215
/**
@@ -222,8 +224,7 @@ class RedundantDocCommentTagInspectionTest : BaseInspectionTest() {
222
224
@Test
223
225
fun testGenericType () {
224
226
assert (
225
- RedundantDocCommentTagInspection (),
226
- """
227
+ RedundantDocCommentTagInspection (), """
227
228
<?php
228
229
class PhpClean {
229
230
/**
0 commit comments