@@ -53,40 +53,50 @@ public function testMatchDefault($testMarker, $testContent='default')
53
53
*
54
54
* @see testMatchDefault()
55
55
*
56
- * @return array
56
+ * @return array<string, array<string, string>>
57
57
*/
58
58
public static function dataMatchDefault ()
59
59
{
60
60
return [
61
- 'simple_match_default ' => ['/* testSimpleMatchDefault */ ' ],
62
- 'match_default_in_switch_case_1 ' => ['/* testMatchDefaultNestedInSwitchCase1 */ ' ],
63
- 'match_default_in_switch_case_2 ' => ['/* testMatchDefaultNestedInSwitchCase2 */ ' ],
64
- 'match_default_in_switch_default ' => ['/* testMatchDefaultNestedInSwitchDefault */ ' ],
65
- 'match_default_containing_switch ' => ['/* testMatchDefault */ ' ],
61
+ 'simple_match_default ' => [
62
+ 'testMarker ' => '/* testSimpleMatchDefault */ ' ,
63
+ ],
64
+ 'match_default_in_switch_case_1 ' => [
65
+ 'testMarker ' => '/* testMatchDefaultNestedInSwitchCase1 */ ' ,
66
+ ],
67
+ 'match_default_in_switch_case_2 ' => [
68
+ 'testMarker ' => '/* testMatchDefaultNestedInSwitchCase2 */ ' ,
69
+ ],
70
+ 'match_default_in_switch_default ' => [
71
+ 'testMarker ' => '/* testMatchDefaultNestedInSwitchDefault */ ' ,
72
+ ],
73
+ 'match_default_containing_switch ' => [
74
+ 'testMarker ' => '/* testMatchDefault */ ' ,
75
+ ],
66
76
67
77
'match_default_with_nested_long_array_and_default_key ' => [
68
- '/* testMatchDefaultWithNestedLongArrayWithClassConstantKey */ ' ,
69
- 'DEFAULT ' ,
78
+ 'testMarker ' => ' /* testMatchDefaultWithNestedLongArrayWithClassConstantKey */ ' ,
79
+ 'testContent ' => ' DEFAULT ' ,
70
80
],
71
81
'match_default_with_nested_long_array_and_default_key_2 ' => [
72
- '/* testMatchDefaultWithNestedLongArrayWithClassConstantKeyLevelDown */ ' ,
73
- 'DEFAULT ' ,
82
+ 'testMarker ' => ' /* testMatchDefaultWithNestedLongArrayWithClassConstantKeyLevelDown */ ' ,
83
+ 'testContent ' => ' DEFAULT ' ,
74
84
],
75
85
'match_default_with_nested_short_array_and_default_key ' => [
76
- '/* testMatchDefaultWithNestedShortArrayWithClassConstantKey */ ' ,
77
- 'DEFAULT ' ,
86
+ 'testMarker ' => ' /* testMatchDefaultWithNestedShortArrayWithClassConstantKey */ ' ,
87
+ 'testContent ' => ' DEFAULT ' ,
78
88
],
79
89
'match_default_with_nested_short_array_and_default_key_2 ' => [
80
- '/* testMatchDefaultWithNestedShortArrayWithClassConstantKeyLevelDown */ ' ,
81
- 'DEFAULT ' ,
90
+ 'testMarker ' => ' /* testMatchDefaultWithNestedShortArrayWithClassConstantKeyLevelDown */ ' ,
91
+ 'testContent ' => ' DEFAULT ' ,
82
92
],
83
93
'match_default_in_long_array ' => [
84
- '/* testMatchDefaultNestedInLongArray */ ' ,
85
- 'DEFAULT ' ,
94
+ 'testMarker ' => ' /* testMatchDefaultNestedInLongArray */ ' ,
95
+ 'testContent ' => ' DEFAULT ' ,
86
96
],
87
97
'match_default_in_short_array ' => [
88
- '/* testMatchDefaultNestedInShortArray */ ' ,
89
- 'DEFAULT ' ,
98
+ 'testMarker ' => ' /* testMatchDefaultNestedInShortArray */ ' ,
99
+ 'testContent ' => ' DEFAULT ' ,
90
100
],
91
101
];
92
102
@@ -169,40 +179,40 @@ public function testSwitchDefault($testMarker, $openerOffset, $closerOffset, $co
169
179
*
170
180
* @see testSwitchDefault()
171
181
*
172
- * @return array
182
+ * @return array<string, array<string, string|int>>
173
183
*/
174
184
public static function dataSwitchDefault ()
175
185
{
176
186
return [
177
187
'simple_switch_default ' => [
178
- '/* testSimpleSwitchDefault */ ' ,
179
- 1 ,
180
- 4 ,
188
+ 'testMarker ' => ' /* testSimpleSwitchDefault */ ' ,
189
+ ' openerOffset ' => 1 ,
190
+ ' closerOffset ' => 4 ,
181
191
],
182
192
'simple_switch_default_with_curlies ' => [
183
193
// For a default structure with curly braces, the scope opener
184
194
// will be the open curly and the closer the close curly.
185
195
// However, scope conditions will not be set for open to close,
186
196
// but only for the open token up to the "break/return/continue" etc.
187
- '/* testSimpleSwitchDefaultWithCurlies */ ' ,
188
- 3 ,
189
- 12 ,
190
- 6 ,
197
+ 'testMarker ' => ' /* testSimpleSwitchDefaultWithCurlies */ ' ,
198
+ ' openerOffset ' => 3 ,
199
+ ' closerOffset ' => 12 ,
200
+ ' conditionStop ' => 6 ,
191
201
],
192
202
'switch_default_toplevel ' => [
193
- '/* testSwitchDefault */ ' ,
194
- 1 ,
195
- 43 ,
203
+ 'testMarker ' => ' /* testSwitchDefault */ ' ,
204
+ ' openerOffset ' => 1 ,
205
+ ' closerOffset ' => 43 ,
196
206
],
197
207
'switch_default_nested_in_match_case ' => [
198
- '/* testSwitchDefaultNestedInMatchCase */ ' ,
199
- 1 ,
200
- 20 ,
208
+ 'testMarker ' => ' /* testSwitchDefaultNestedInMatchCase */ ' ,
209
+ ' openerOffset ' => 1 ,
210
+ ' closerOffset ' => 20 ,
201
211
],
202
212
'switch_default_nested_in_match_default ' => [
203
- '/* testSwitchDefaultNestedInMatchDefault */ ' ,
204
- 1 ,
205
- 18 ,
213
+ 'testMarker ' => ' /* testSwitchDefaultNestedInMatchDefault */ ' ,
214
+ ' openerOffset ' => 1 ,
215
+ ' closerOffset ' => 18 ,
206
216
],
207
217
];
208
218
@@ -244,34 +254,68 @@ public function testNotDefaultKeyword($testMarker, $testContent='DEFAULT')
244
254
*
245
255
* @see testNotDefaultKeyword()
246
256
*
247
- * @return array
257
+ * @return array<string, array<string, string>>
248
258
*/
249
259
public static function dataNotDefaultKeyword ()
250
260
{
251
261
return [
252
- 'class-constant-as-short-array-key ' => ['/* testClassConstantAsShortArrayKey */ ' ],
253
- 'class-property-as-short-array-key ' => ['/* testClassPropertyAsShortArrayKey */ ' ],
254
- 'namespaced-constant-as-short-array-key ' => ['/* testNamespacedConstantAsShortArrayKey */ ' ],
255
- 'fqn-global-constant-as-short-array-key ' => ['/* testFQNGlobalConstantAsShortArrayKey */ ' ],
256
- 'class-constant-as-long-array-key ' => ['/* testClassConstantAsLongArrayKey */ ' ],
257
- 'class-constant-as-yield-key ' => ['/* testClassConstantAsYieldKey */ ' ],
258
-
259
- 'class-constant-as-long-array-key-nested-in-match ' => ['/* testClassConstantAsLongArrayKeyNestedInMatch */ ' ],
260
- 'class-constant-as-long-array-key-nested-in-match-2 ' => ['/* testClassConstantAsLongArrayKeyNestedInMatchLevelDown */ ' ],
261
- 'class-constant-as-short-array-key-nested-in-match ' => ['/* testClassConstantAsShortArrayKeyNestedInMatch */ ' ],
262
- 'class-constant-as-short-array-key-nested-in-match-2 ' => ['/* testClassConstantAsShortArrayKeyNestedInMatchLevelDown */ ' ],
263
- 'class-constant-as-long-array-key-with-nested-match ' => ['/* testClassConstantAsLongArrayKeyWithNestedMatch */ ' ],
264
- 'class-constant-as-short-array-key-with-nested-match ' => ['/* testClassConstantAsShortArrayKeyWithNestedMatch */ ' ],
265
-
266
- 'class-constant-in-switch-case ' => ['/* testClassConstantInSwitchCase */ ' ],
267
- 'class-property-in-switch-case ' => ['/* testClassPropertyInSwitchCase */ ' ],
268
- 'namespaced-constant-in-switch-case ' => ['/* testNamespacedConstantInSwitchCase */ ' ],
269
- 'namespace-relative-constant-in-switch-case ' => ['/* testNamespaceRelativeConstantInSwitchCase */ ' ],
270
-
271
- 'class-constant-declaration ' => ['/* testClassConstant */ ' ],
262
+ 'class-constant-as-short-array-key ' => [
263
+ 'testMarker ' => '/* testClassConstantAsShortArrayKey */ ' ,
264
+ ],
265
+ 'class-property-as-short-array-key ' => [
266
+ 'testMarker ' => '/* testClassPropertyAsShortArrayKey */ ' ,
267
+ ],
268
+ 'namespaced-constant-as-short-array-key ' => [
269
+ 'testMarker ' => '/* testNamespacedConstantAsShortArrayKey */ ' ,
270
+ ],
271
+ 'fqn-global-constant-as-short-array-key ' => [
272
+ 'testMarker ' => '/* testFQNGlobalConstantAsShortArrayKey */ ' ,
273
+ ],
274
+ 'class-constant-as-long-array-key ' => [
275
+ 'testMarker ' => '/* testClassConstantAsLongArrayKey */ ' ,
276
+ ],
277
+ 'class-constant-as-yield-key ' => [
278
+ 'testMarker ' => '/* testClassConstantAsYieldKey */ ' ,
279
+ ],
280
+
281
+ 'class-constant-as-long-array-key-nested-in-match ' => [
282
+ 'testMarker ' => '/* testClassConstantAsLongArrayKeyNestedInMatch */ ' ,
283
+ ],
284
+ 'class-constant-as-long-array-key-nested-in-match-2 ' => [
285
+ 'testMarker ' => '/* testClassConstantAsLongArrayKeyNestedInMatchLevelDown */ ' ,
286
+ ],
287
+ 'class-constant-as-short-array-key-nested-in-match ' => [
288
+ 'testMarker ' => '/* testClassConstantAsShortArrayKeyNestedInMatch */ ' ,
289
+ ],
290
+ 'class-constant-as-short-array-key-nested-in-match-2 ' => [
291
+ 'testMarker ' => '/* testClassConstantAsShortArrayKeyNestedInMatchLevelDown */ ' ,
292
+ ],
293
+ 'class-constant-as-long-array-key-with-nested-match ' => [
294
+ 'testMarker ' => '/* testClassConstantAsLongArrayKeyWithNestedMatch */ ' ,
295
+ ],
296
+ 'class-constant-as-short-array-key-with-nested-match ' => [
297
+ 'testMarker ' => '/* testClassConstantAsShortArrayKeyWithNestedMatch */ ' ,
298
+ ],
299
+
300
+ 'class-constant-in-switch-case ' => [
301
+ 'testMarker ' => '/* testClassConstantInSwitchCase */ ' ,
302
+ ],
303
+ 'class-property-in-switch-case ' => [
304
+ 'testMarker ' => '/* testClassPropertyInSwitchCase */ ' ,
305
+ ],
306
+ 'namespaced-constant-in-switch-case ' => [
307
+ 'testMarker ' => '/* testNamespacedConstantInSwitchCase */ ' ,
308
+ ],
309
+ 'namespace-relative-constant-in-switch-case ' => [
310
+ 'testMarker ' => '/* testNamespaceRelativeConstantInSwitchCase */ ' ,
311
+ ],
312
+
313
+ 'class-constant-declaration ' => [
314
+ 'testMarker ' => '/* testClassConstant */ ' ,
315
+ ],
272
316
'class-method-declaration ' => [
273
- '/* testMethodDeclaration */ ' ,
274
- 'default ' ,
317
+ 'testMarker ' => ' /* testMethodDeclaration */ ' ,
318
+ 'testContent ' => ' default ' ,
275
319
],
276
320
];
277
321
0 commit comments