Skip to content

Commit b1c2254

Browse files
committed
Unit tests for #3051 (ref #2770)
1 parent e5afcb2 commit b1c2254

File tree

3 files changed

+113
-87
lines changed

3 files changed

+113
-87
lines changed

src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,3 +1000,15 @@ public function foo(object $a, ?object $b) {}
10001000
* @return void
10011001
*/
10021002
function foo($foo) {}
1003+
1004+
/**
1005+
* {@inheritDoc}
1006+
*/
1007+
public function foo($a, $b) {}
1008+
1009+
// phpcs:set Squiz.Commenting.FunctionComment skipIfInheritdoc true
1010+
1011+
/**
1012+
* {@inheritDoc}
1013+
*/
1014+
public function foo($a, $b) {}

src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc.fixed

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,3 +1000,15 @@ public function foo(object $a, ?object $b) {}
10001000
* @return void
10011001
*/
10021002
function foo($foo) {}
1003+
1004+
/**
1005+
* {@inheritDoc}
1006+
*/
1007+
public function foo($a, $b) {}
1008+
1009+
// phpcs:set Squiz.Commenting.FunctionComment skipIfInheritdoc true
1010+
1011+
/**
1012+
* {@inheritDoc}
1013+
*/
1014+
public function foo($a, $b) {}

src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.php

Lines changed: 89 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -26,93 +26,95 @@ class FunctionCommentUnitTest extends AbstractSniffUnitTest
2626
public function getErrorList()
2727
{
2828
$errors = [
29-
5 => 1,
30-
10 => 3,
31-
12 => 2,
32-
13 => 2,
33-
14 => 1,
34-
15 => 1,
35-
28 => 1,
36-
43 => 1,
37-
76 => 1,
38-
87 => 1,
39-
103 => 1,
40-
109 => 1,
41-
112 => 1,
42-
122 => 1,
43-
123 => 3,
44-
124 => 2,
45-
125 => 1,
46-
126 => 1,
47-
137 => 4,
48-
138 => 4,
49-
139 => 4,
50-
143 => 2,
51-
152 => 1,
52-
155 => 2,
53-
159 => 1,
54-
166 => 1,
55-
173 => 1,
56-
183 => 1,
57-
190 => 2,
58-
193 => 2,
59-
196 => 1,
60-
199 => 2,
61-
210 => 1,
62-
211 => 1,
63-
222 => 1,
64-
223 => 1,
65-
224 => 1,
66-
225 => 1,
67-
226 => 1,
68-
227 => 1,
69-
230 => 2,
70-
232 => 2,
71-
246 => 1,
72-
248 => 4,
73-
261 => 1,
74-
263 => 1,
75-
276 => 1,
76-
277 => 1,
77-
278 => 1,
78-
279 => 1,
79-
280 => 1,
80-
281 => 1,
81-
284 => 1,
82-
286 => 7,
83-
294 => 1,
84-
302 => 1,
85-
312 => 1,
86-
358 => 1,
87-
359 => 2,
88-
372 => 1,
89-
373 => 1,
90-
387 => 1,
91-
407 => 1,
92-
441 => 1,
93-
500 => 1,
94-
526 => 1,
95-
548 => 1,
96-
641 => 1,
97-
669 => 1,
98-
688 => 1,
99-
744 => 1,
100-
748 => 1,
101-
767 => 1,
102-
789 => 1,
103-
792 => 1,
104-
794 => 1,
105-
797 => 1,
106-
801 => 1,
107-
828 => 1,
108-
840 => 1,
109-
852 => 1,
110-
864 => 1,
111-
886 => 1,
112-
888 => 1,
113-
890 => 1,
114-
978 => 1,
115-
997 => 1,
29+
5 => 1,
30+
10 => 3,
31+
12 => 2,
32+
13 => 2,
33+
14 => 1,
34+
15 => 1,
35+
28 => 1,
36+
43 => 1,
37+
76 => 1,
38+
87 => 1,
39+
103 => 1,
40+
109 => 1,
41+
112 => 1,
42+
122 => 1,
43+
123 => 3,
44+
124 => 2,
45+
125 => 1,
46+
126 => 1,
47+
137 => 4,
48+
138 => 4,
49+
139 => 4,
50+
143 => 2,
51+
152 => 1,
52+
155 => 2,
53+
159 => 1,
54+
166 => 1,
55+
173 => 1,
56+
183 => 1,
57+
190 => 2,
58+
193 => 2,
59+
196 => 1,
60+
199 => 2,
61+
210 => 1,
62+
211 => 1,
63+
222 => 1,
64+
223 => 1,
65+
224 => 1,
66+
225 => 1,
67+
226 => 1,
68+
227 => 1,
69+
230 => 2,
70+
232 => 2,
71+
246 => 1,
72+
248 => 4,
73+
261 => 1,
74+
263 => 1,
75+
276 => 1,
76+
277 => 1,
77+
278 => 1,
78+
279 => 1,
79+
280 => 1,
80+
281 => 1,
81+
284 => 1,
82+
286 => 7,
83+
294 => 1,
84+
302 => 1,
85+
312 => 1,
86+
358 => 1,
87+
359 => 2,
88+
372 => 1,
89+
373 => 1,
90+
387 => 1,
91+
407 => 1,
92+
441 => 1,
93+
500 => 1,
94+
526 => 1,
95+
548 => 1,
96+
641 => 1,
97+
669 => 1,
98+
688 => 1,
99+
744 => 1,
100+
748 => 1,
101+
767 => 1,
102+
789 => 1,
103+
792 => 1,
104+
794 => 1,
105+
797 => 1,
106+
801 => 1,
107+
828 => 1,
108+
840 => 1,
109+
852 => 1,
110+
864 => 1,
111+
886 => 1,
112+
888 => 1,
113+
890 => 1,
114+
978 => 1,
115+
997 => 1,
116+
1004 => 2,
117+
1006 => 1,
116118
];
117119

118120
// Scalar type hints only work from PHP 7 onwards.

0 commit comments

Comments
 (0)