@@ -45,9 +45,9 @@ public function testDescribeRouteCollection(RouteCollection $routes, $expectedDe
45
45
$ this ->assertDescription ($ expectedDescription , $ routes );
46
46
}
47
47
48
- public function getDescribeRouteCollectionTestData ()
48
+ public static function getDescribeRouteCollectionTestData (): array
49
49
{
50
- return $ this -> getDescriptionTestData (ObjectsProvider::getRouteCollections ());
50
+ return static :: getDescriptionTestData (ObjectsProvider::getRouteCollections ());
51
51
}
52
52
53
53
/** @dataProvider getDescribeRouteTestData */
@@ -56,9 +56,9 @@ public function testDescribeRoute(Route $route, $expectedDescription)
56
56
$ this ->assertDescription ($ expectedDescription , $ route );
57
57
}
58
58
59
- public function getDescribeRouteTestData ()
59
+ public static function getDescribeRouteTestData (): array
60
60
{
61
- return $ this -> getDescriptionTestData (ObjectsProvider::getRoutes ());
61
+ return static :: getDescriptionTestData (ObjectsProvider::getRoutes ());
62
62
}
63
63
64
64
/** @dataProvider getDescribeContainerParametersTestData */
@@ -67,9 +67,9 @@ public function testDescribeContainerParameters(ParameterBag $parameters, $expec
67
67
$ this ->assertDescription ($ expectedDescription , $ parameters );
68
68
}
69
69
70
- public function getDescribeContainerParametersTestData ()
70
+ public static function getDescribeContainerParametersTestData (): array
71
71
{
72
- return $ this -> getDescriptionTestData (ObjectsProvider::getContainerParameters ());
72
+ return static :: getDescriptionTestData (ObjectsProvider::getContainerParameters ());
73
73
}
74
74
75
75
/** @dataProvider getDescribeContainerBuilderTestData */
@@ -78,9 +78,9 @@ public function testDescribeContainerBuilder(ContainerBuilder $builder, $expecte
78
78
$ this ->assertDescription ($ expectedDescription , $ builder , $ options );
79
79
}
80
80
81
- public function getDescribeContainerBuilderTestData ()
81
+ public static function getDescribeContainerBuilderTestData (): array
82
82
{
83
- return $ this -> getContainerBuilderDescriptionTestData (ObjectsProvider::getContainerBuilders ());
83
+ return static :: getContainerBuilderDescriptionTestData (ObjectsProvider::getContainerBuilders ());
84
84
}
85
85
86
86
/**
@@ -91,9 +91,9 @@ public function testDescribeContainerExistingClassDefinition(Definition $definit
91
91
$ this ->assertDescription ($ expectedDescription , $ definition );
92
92
}
93
93
94
- public function getDescribeContainerExistingClassDefinitionTestData ()
94
+ public static function getDescribeContainerExistingClassDefinitionTestData (): array
95
95
{
96
- return $ this -> getDescriptionTestData (ObjectsProvider::getContainerDefinitionsWithExistingClasses ());
96
+ return static :: getDescriptionTestData (ObjectsProvider::getContainerDefinitionsWithExistingClasses ());
97
97
}
98
98
99
99
/** @dataProvider getDescribeContainerDefinitionTestData */
@@ -102,9 +102,9 @@ public function testDescribeContainerDefinition(Definition $definition, $expecte
102
102
$ this ->assertDescription ($ expectedDescription , $ definition );
103
103
}
104
104
105
- public function getDescribeContainerDefinitionTestData ()
105
+ public static function getDescribeContainerDefinitionTestData (): array
106
106
{
107
- return $ this -> getDescriptionTestData (ObjectsProvider::getContainerDefinitions ());
107
+ return static :: getDescriptionTestData (ObjectsProvider::getContainerDefinitions ());
108
108
}
109
109
110
110
/** @dataProvider getDescribeContainerDefinitionWithArgumentsShownTestData */
@@ -113,7 +113,7 @@ public function testDescribeContainerDefinitionWithArgumentsShown(Definition $de
113
113
$ this ->assertDescription ($ expectedDescription , $ definition , ['show_arguments ' => true ]);
114
114
}
115
115
116
- public function getDescribeContainerDefinitionWithArgumentsShownTestData ()
116
+ public static function getDescribeContainerDefinitionWithArgumentsShownTestData (): array
117
117
{
118
118
$ definitions = ObjectsProvider::getContainerDefinitions ();
119
119
$ definitionsWithArgs = [];
@@ -124,7 +124,7 @@ public function getDescribeContainerDefinitionWithArgumentsShownTestData()
124
124
125
125
$ definitionsWithArgs ['definition_arguments_with_enum ' ] = (new Definition ('definition_with_enum ' ))->setArgument (0 , FooUnitEnum::FOO );
126
126
127
- return $ this -> getDescriptionTestData ($ definitionsWithArgs );
127
+ return static :: getDescriptionTestData ($ definitionsWithArgs );
128
128
}
129
129
130
130
/** @dataProvider getDescribeContainerAliasTestData */
@@ -133,9 +133,9 @@ public function testDescribeContainerAlias(Alias $alias, $expectedDescription)
133
133
$ this ->assertDescription ($ expectedDescription , $ alias );
134
134
}
135
135
136
- public function getDescribeContainerAliasTestData ()
136
+ public static function getDescribeContainerAliasTestData (): array
137
137
{
138
- return $ this -> getDescriptionTestData (ObjectsProvider::getContainerAliases ());
138
+ return static :: getDescriptionTestData (ObjectsProvider::getContainerAliases ());
139
139
}
140
140
141
141
/** @dataProvider getDescribeContainerDefinitionWhichIsAnAliasTestData */
@@ -144,7 +144,7 @@ public function testDescribeContainerDefinitionWhichIsAnAlias(Alias $alias, $exp
144
144
$ this ->assertDescription ($ expectedDescription , $ builder , $ options );
145
145
}
146
146
147
- public function getDescribeContainerDefinitionWhichIsAnAliasTestData ()
147
+ public static function getDescribeContainerDefinitionWhichIsAnAliasTestData (): array
148
148
{
149
149
$ builder = current (ObjectsProvider::getContainerBuilders ());
150
150
$ builder ->setDefinition ('service_1 ' , $ builder ->getDefinition ('definition_1 ' ));
@@ -157,7 +157,7 @@ public function getDescribeContainerDefinitionWhichIsAnAliasTestData()
157
157
}
158
158
159
159
$ i = 0 ;
160
- $ data = $ this -> getDescriptionTestData ($ aliasesWithDefinitions );
160
+ $ data = static :: getDescriptionTestData ($ aliasesWithDefinitions );
161
161
foreach ($ aliases as $ name => $ alias ) {
162
162
$ file = array_pop ($ data [$ i ]);
163
163
$ data [$ i ][] = $ builder ;
@@ -175,9 +175,9 @@ public function testDescribeContainerParameter($parameter, $expectedDescription,
175
175
$ this ->assertDescription ($ expectedDescription , $ parameter , $ options );
176
176
}
177
177
178
- public function getDescribeContainerParameterTestData ()
178
+ public static function getDescribeContainerParameterTestData (): array
179
179
{
180
- $ data = $ this -> getDescriptionTestData (ObjectsProvider::getContainerParameter ());
180
+ $ data = static :: getDescriptionTestData (ObjectsProvider::getContainerParameter ());
181
181
182
182
$ file = array_pop ($ data [0 ]);
183
183
$ data [0 ][] = ['parameter ' => 'database_name ' ];
@@ -195,9 +195,9 @@ public function testDescribeEventDispatcher(EventDispatcher $eventDispatcher, $e
195
195
$ this ->assertDescription ($ expectedDescription , $ eventDispatcher , $ options );
196
196
}
197
197
198
- public function getDescribeEventDispatcherTestData ()
198
+ public static function getDescribeEventDispatcherTestData (): array
199
199
{
200
- return $ this -> getEventDispatcherDescriptionTestData (ObjectsProvider::getEventDispatchers ());
200
+ return static :: getEventDispatcherDescriptionTestData (ObjectsProvider::getEventDispatchers ());
201
201
}
202
202
203
203
/** @dataProvider getDescribeCallableTestData */
@@ -206,23 +206,24 @@ public function testDescribeCallable($callable, $expectedDescription)
206
206
$ this ->assertDescription ($ expectedDescription , $ callable );
207
207
}
208
208
209
- public function getDescribeCallableTestData (): array
209
+ public static function getDescribeCallableTestData (): array
210
210
{
211
- return $ this -> getDescriptionTestData (ObjectsProvider::getCallables ());
211
+ return static :: getDescriptionTestData (ObjectsProvider::getCallables ());
212
212
}
213
213
214
214
/**
215
215
* @group legacy
216
+ *
216
217
* @dataProvider getDescribeDeprecatedCallableTestData
217
218
*/
218
219
public function testDescribeDeprecatedCallable ($ callable , $ expectedDescription )
219
220
{
220
221
$ this ->assertDescription ($ expectedDescription , $ callable );
221
222
}
222
223
223
- public function getDescribeDeprecatedCallableTestData (): array
224
+ public static function getDescribeDeprecatedCallableTestData (): array
224
225
{
225
- return $ this -> getDescriptionTestData (ObjectsProvider::getDeprecatedCallables ());
226
+ return static :: getDescriptionTestData (ObjectsProvider::getDeprecatedCallables ());
226
227
}
227
228
228
229
/** @dataProvider getClassDescriptionTestData */
@@ -231,7 +232,7 @@ public function testGetClassDescription($object, $expectedDescription)
231
232
$ this ->assertEquals ($ expectedDescription , $ this ->getDescriptor ()->getClassDescription ($ object ));
232
233
}
233
234
234
- public function getClassDescriptionTestData ()
235
+ public static function getClassDescriptionTestData (): array
235
236
{
236
237
return [
237
238
[ClassWithDocCommentOnMultipleLines::class, 'This is the first line of the description. This is the second line. ' ],
@@ -249,14 +250,14 @@ public function testGetDeprecations(ContainerBuilder $builder, $expectedDescript
249
250
$ this ->assertDescription ($ expectedDescription , $ builder , ['deprecations ' => true ]);
250
251
}
251
252
252
- public function getDeprecationsTestData ()
253
+ public static function getDeprecationsTestData (): array
253
254
{
254
- return $ this -> getDescriptionTestData (ObjectsProvider::getContainerDeprecations ());
255
+ return static :: getDescriptionTestData (ObjectsProvider::getContainerDeprecations ());
255
256
}
256
257
257
- abstract protected function getDescriptor ();
258
+ abstract protected static function getDescriptor ();
258
259
259
- abstract protected function getFormat ();
260
+ abstract protected static function getFormat ();
260
261
261
262
private function assertDescription ($ expectedDescription , $ describedObject , array $ options = [])
262
263
{
@@ -278,19 +279,19 @@ private function assertDescription($expectedDescription, $describedObject, array
278
279
}
279
280
}
280
281
281
- private function getDescriptionTestData (iterable $ objects )
282
+ private static function getDescriptionTestData (iterable $ objects ): array
282
283
{
283
284
$ data = [];
284
285
foreach ($ objects as $ name => $ object ) {
285
- $ file = sprintf ('%s.%s ' , trim ($ name , '. ' ), $ this -> getFormat ());
286
+ $ file = sprintf ('%s.%s ' , trim ($ name , '. ' ), static :: getFormat ());
286
287
$ description = file_get_contents (__DIR__ .'/../../Fixtures/Descriptor/ ' .$ file );
287
288
$ data [] = [$ object , $ description , $ file ];
288
289
}
289
290
290
291
return $ data ;
291
292
}
292
293
293
- private function getContainerBuilderDescriptionTestData (array $ objects )
294
+ private static function getContainerBuilderDescriptionTestData (array $ objects ): array
294
295
{
295
296
$ variations = [
296
297
'services ' => ['show_hidden ' => true ],
@@ -303,7 +304,7 @@ private function getContainerBuilderDescriptionTestData(array $objects)
303
304
$ data = [];
304
305
foreach ($ objects as $ name => $ object ) {
305
306
foreach ($ variations as $ suffix => $ options ) {
306
- $ file = sprintf ('%s_%s.%s ' , trim ($ name , '. ' ), $ suffix , $ this -> getFormat ());
307
+ $ file = sprintf ('%s_%s.%s ' , trim ($ name , '. ' ), $ suffix , static :: getFormat ());
307
308
$ description = file_get_contents (__DIR__ .'/../../Fixtures/Descriptor/ ' .$ file );
308
309
$ data [] = [$ object , $ description , $ options , $ file ];
309
310
}
@@ -312,7 +313,7 @@ private function getContainerBuilderDescriptionTestData(array $objects)
312
313
return $ data ;
313
314
}
314
315
315
- private function getEventDispatcherDescriptionTestData (array $ objects )
316
+ private static function getEventDispatcherDescriptionTestData (array $ objects ): array
316
317
{
317
318
$ variations = [
318
319
'events ' => [],
@@ -322,7 +323,7 @@ private function getEventDispatcherDescriptionTestData(array $objects)
322
323
$ data = [];
323
324
foreach ($ objects as $ name => $ object ) {
324
325
foreach ($ variations as $ suffix => $ options ) {
325
- $ file = sprintf ('%s_%s.%s ' , trim ($ name , '. ' ), $ suffix , $ this -> getFormat ());
326
+ $ file = sprintf ('%s_%s.%s ' , trim ($ name , '. ' ), $ suffix , static :: getFormat ());
326
327
$ description = file_get_contents (__DIR__ .'/../../Fixtures/Descriptor/ ' .$ file );
327
328
$ data [] = [$ object , $ description , $ options , $ file ];
328
329
}
@@ -337,13 +338,13 @@ public function testDescribeContainerBuilderWithPriorityTags(ContainerBuilder $b
337
338
$ this ->assertDescription ($ expectedDescription , $ builder , $ options );
338
339
}
339
340
340
- public function getDescribeContainerBuilderWithPriorityTagsTestData (): array
341
+ public static function getDescribeContainerBuilderWithPriorityTagsTestData (): array
341
342
{
342
343
$ variations = ['priority_tag ' => ['tag ' => 'tag1 ' ]];
343
344
$ data = [];
344
345
foreach (ObjectsProvider::getContainerBuildersWithPriorityTags () as $ name => $ object ) {
345
346
foreach ($ variations as $ suffix => $ options ) {
346
- $ file = sprintf ('%s_%s.%s ' , trim ($ name , '. ' ), $ suffix , $ this -> getFormat ());
347
+ $ file = sprintf ('%s_%s.%s ' , trim ($ name , '. ' ), $ suffix , static :: getFormat ());
347
348
$ description = file_get_contents (__DIR__ .'/../../Fixtures/Descriptor/ ' .$ file );
348
349
$ data [] = [$ object , $ description , $ options ];
349
350
}
0 commit comments