@@ -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 = [];
@@ -126,7 +126,7 @@ public function getDescribeContainerDefinitionWithArgumentsShownTestData()
126
126
$ definitionsWithArgs ['definition_arguments_with_enum ' ] = (new Definition ('definition_with_enum ' ))->setArgument (0 , FooUnitEnum::FOO );
127
127
}
128
128
129
- return $ this -> getDescriptionTestData ($ definitionsWithArgs );
129
+ return static :: getDescriptionTestData ($ definitionsWithArgs );
130
130
}
131
131
132
132
/** @dataProvider getDescribeContainerAliasTestData */
@@ -135,9 +135,9 @@ public function testDescribeContainerAlias(Alias $alias, $expectedDescription)
135
135
$ this ->assertDescription ($ expectedDescription , $ alias );
136
136
}
137
137
138
- public function getDescribeContainerAliasTestData ()
138
+ public static function getDescribeContainerAliasTestData (): array
139
139
{
140
- return $ this -> getDescriptionTestData (ObjectsProvider::getContainerAliases ());
140
+ return static :: getDescriptionTestData (ObjectsProvider::getContainerAliases ());
141
141
}
142
142
143
143
/** @dataProvider getDescribeContainerDefinitionWhichIsAnAliasTestData */
@@ -146,7 +146,7 @@ public function testDescribeContainerDefinitionWhichIsAnAlias(Alias $alias, $exp
146
146
$ this ->assertDescription ($ expectedDescription , $ builder , $ options );
147
147
}
148
148
149
- public function getDescribeContainerDefinitionWhichIsAnAliasTestData ()
149
+ public static function getDescribeContainerDefinitionWhichIsAnAliasTestData (): array
150
150
{
151
151
$ builder = current (ObjectsProvider::getContainerBuilders ());
152
152
$ builder ->setDefinition ('service_1 ' , $ builder ->getDefinition ('definition_1 ' ));
@@ -159,7 +159,7 @@ public function getDescribeContainerDefinitionWhichIsAnAliasTestData()
159
159
}
160
160
161
161
$ i = 0 ;
162
- $ data = $ this -> getDescriptionTestData ($ aliasesWithDefinitions );
162
+ $ data = static :: getDescriptionTestData ($ aliasesWithDefinitions );
163
163
foreach ($ aliases as $ name => $ alias ) {
164
164
$ file = array_pop ($ data [$ i ]);
165
165
$ data [$ i ][] = $ builder ;
@@ -177,9 +177,9 @@ public function testDescribeContainerParameter($parameter, $expectedDescription,
177
177
$ this ->assertDescription ($ expectedDescription , $ parameter , $ options );
178
178
}
179
179
180
- public function getDescribeContainerParameterTestData ()
180
+ public static function getDescribeContainerParameterTestData (): array
181
181
{
182
- $ data = $ this -> getDescriptionTestData (ObjectsProvider::getContainerParameter ());
182
+ $ data = static :: getDescriptionTestData (ObjectsProvider::getContainerParameter ());
183
183
184
184
$ file = array_pop ($ data [0 ]);
185
185
$ data [0 ][] = ['parameter ' => 'database_name ' ];
@@ -197,9 +197,9 @@ public function testDescribeEventDispatcher(EventDispatcher $eventDispatcher, $e
197
197
$ this ->assertDescription ($ expectedDescription , $ eventDispatcher , $ options );
198
198
}
199
199
200
- public function getDescribeEventDispatcherTestData ()
200
+ public static function getDescribeEventDispatcherTestData (): array
201
201
{
202
- return $ this -> getEventDispatcherDescriptionTestData (ObjectsProvider::getEventDispatchers ());
202
+ return static :: getEventDispatcherDescriptionTestData (ObjectsProvider::getEventDispatchers ());
203
203
}
204
204
205
205
/** @dataProvider getDescribeCallableTestData */
@@ -208,23 +208,24 @@ public function testDescribeCallable($callable, $expectedDescription)
208
208
$ this ->assertDescription ($ expectedDescription , $ callable );
209
209
}
210
210
211
- public function getDescribeCallableTestData (): array
211
+ public static function getDescribeCallableTestData (): array
212
212
{
213
- return $ this -> getDescriptionTestData (ObjectsProvider::getCallables ());
213
+ return static :: getDescriptionTestData (ObjectsProvider::getCallables ());
214
214
}
215
215
216
216
/**
217
217
* @group legacy
218
+ *
218
219
* @dataProvider getDescribeDeprecatedCallableTestData
219
220
*/
220
221
public function testDescribeDeprecatedCallable ($ callable , $ expectedDescription )
221
222
{
222
223
$ this ->assertDescription ($ expectedDescription , $ callable );
223
224
}
224
225
225
- public function getDescribeDeprecatedCallableTestData (): array
226
+ public static function getDescribeDeprecatedCallableTestData (): array
226
227
{
227
- return $ this -> getDescriptionTestData (ObjectsProvider::getDeprecatedCallables ());
228
+ return static :: getDescriptionTestData (ObjectsProvider::getDeprecatedCallables ());
228
229
}
229
230
230
231
/** @dataProvider getClassDescriptionTestData */
@@ -233,7 +234,7 @@ public function testGetClassDescription($object, $expectedDescription)
233
234
$ this ->assertEquals ($ expectedDescription , $ this ->getDescriptor ()->getClassDescription ($ object ));
234
235
}
235
236
236
- public function getClassDescriptionTestData ()
237
+ public static function getClassDescriptionTestData (): array
237
238
{
238
239
return [
239
240
[ClassWithDocCommentOnMultipleLines::class, 'This is the first line of the description. This is the second line. ' ],
@@ -251,14 +252,14 @@ public function testGetDeprecations(ContainerBuilder $builder, $expectedDescript
251
252
$ this ->assertDescription ($ expectedDescription , $ builder , ['deprecations ' => true ]);
252
253
}
253
254
254
- public function getDeprecationsTestData ()
255
+ public static function getDeprecationsTestData (): array
255
256
{
256
- return $ this -> getDescriptionTestData (ObjectsProvider::getContainerDeprecations ());
257
+ return static :: getDescriptionTestData (ObjectsProvider::getContainerDeprecations ());
257
258
}
258
259
259
- abstract protected function getDescriptor ();
260
+ abstract protected static function getDescriptor ();
260
261
261
- abstract protected function getFormat ();
262
+ abstract protected static function getFormat ();
262
263
263
264
private function assertDescription ($ expectedDescription , $ describedObject , array $ options = [])
264
265
{
@@ -280,19 +281,19 @@ private function assertDescription($expectedDescription, $describedObject, array
280
281
}
281
282
}
282
283
283
- private function getDescriptionTestData (iterable $ objects )
284
+ private static function getDescriptionTestData (iterable $ objects ): array
284
285
{
285
286
$ data = [];
286
287
foreach ($ objects as $ name => $ object ) {
287
- $ file = sprintf ('%s.%s ' , trim ($ name , '. ' ), $ this -> getFormat ());
288
+ $ file = sprintf ('%s.%s ' , trim ($ name , '. ' ), static :: getFormat ());
288
289
$ description = file_get_contents (__DIR__ .'/../../Fixtures/Descriptor/ ' .$ file );
289
290
$ data [] = [$ object , $ description , $ file ];
290
291
}
291
292
292
293
return $ data ;
293
294
}
294
295
295
- private function getContainerBuilderDescriptionTestData (array $ objects )
296
+ private static function getContainerBuilderDescriptionTestData (array $ objects ): array
296
297
{
297
298
$ variations = [
298
299
'services ' => ['show_hidden ' => true ],
@@ -305,7 +306,7 @@ private function getContainerBuilderDescriptionTestData(array $objects)
305
306
$ data = [];
306
307
foreach ($ objects as $ name => $ object ) {
307
308
foreach ($ variations as $ suffix => $ options ) {
308
- $ file = sprintf ('%s_%s.%s ' , trim ($ name , '. ' ), $ suffix , $ this -> getFormat ());
309
+ $ file = sprintf ('%s_%s.%s ' , trim ($ name , '. ' ), $ suffix , static :: getFormat ());
309
310
$ description = file_get_contents (__DIR__ .'/../../Fixtures/Descriptor/ ' .$ file );
310
311
$ data [] = [$ object , $ description , $ options , $ file ];
311
312
}
@@ -314,7 +315,7 @@ private function getContainerBuilderDescriptionTestData(array $objects)
314
315
return $ data ;
315
316
}
316
317
317
- private function getEventDispatcherDescriptionTestData (array $ objects )
318
+ private static function getEventDispatcherDescriptionTestData (array $ objects ): array
318
319
{
319
320
$ variations = [
320
321
'events ' => [],
@@ -324,7 +325,7 @@ private function getEventDispatcherDescriptionTestData(array $objects)
324
325
$ data = [];
325
326
foreach ($ objects as $ name => $ object ) {
326
327
foreach ($ variations as $ suffix => $ options ) {
327
- $ file = sprintf ('%s_%s.%s ' , trim ($ name , '. ' ), $ suffix , $ this -> getFormat ());
328
+ $ file = sprintf ('%s_%s.%s ' , trim ($ name , '. ' ), $ suffix , static :: getFormat ());
328
329
$ description = file_get_contents (__DIR__ .'/../../Fixtures/Descriptor/ ' .$ file );
329
330
$ data [] = [$ object , $ description , $ options , $ file ];
330
331
}
@@ -339,13 +340,13 @@ public function testDescribeContainerBuilderWithPriorityTags(ContainerBuilder $b
339
340
$ this ->assertDescription ($ expectedDescription , $ builder , $ options );
340
341
}
341
342
342
- public function getDescribeContainerBuilderWithPriorityTagsTestData (): array
343
+ public static function getDescribeContainerBuilderWithPriorityTagsTestData (): array
343
344
{
344
345
$ variations = ['priority_tag ' => ['tag ' => 'tag1 ' ]];
345
346
$ data = [];
346
347
foreach (ObjectsProvider::getContainerBuildersWithPriorityTags () as $ name => $ object ) {
347
348
foreach ($ variations as $ suffix => $ options ) {
348
- $ file = sprintf ('%s_%s.%s ' , trim ($ name , '. ' ), $ suffix , $ this -> getFormat ());
349
+ $ file = sprintf ('%s_%s.%s ' , trim ($ name , '. ' ), $ suffix , static :: getFormat ());
349
350
$ description = file_get_contents (__DIR__ .'/../../Fixtures/Descriptor/ ' .$ file );
350
351
$ data [] = [$ object , $ description , $ options ];
351
352
}
0 commit comments