@@ -293,7 +293,10 @@ configuration::
293
293
{
294
294
// ... prepare your $config variable
295
295
296
- $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
296
+ $loader = new XmlFileLoader(
297
+ $container,
298
+ new FileLocator(__DIR__.'/../Resources/config')
299
+ );
297
300
$loader->load('services.xml');
298
301
}
299
302
@@ -305,7 +308,10 @@ option is passed and set to true::
305
308
{
306
309
// ... prepare your $config variable
307
310
308
- $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
311
+ $loader = new XmlFileLoader(
312
+ $container,
313
+ new FileLocator(__DIR__.'/../Resources/config')
314
+ );
309
315
310
316
if (isset($config['enabled']) && $config['enabled']) {
311
317
$loader->load('services.xml');
@@ -351,14 +357,22 @@ Add the following to the ``load()`` method to do this::
351
357
{
352
358
// ... prepare your $config variable
353
359
354
- $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
360
+ $loader = new XmlFileLoader(
361
+ $container,
362
+ new FileLocator(__DIR__.'/../Resources/config')
363
+ );
355
364
$loader->load('services.xml');
356
365
357
366
if (!isset($config['my_type'])) {
358
- throw new \InvalidArgumentException('The "my_type" option must be set');
367
+ throw new \InvalidArgumentException(
368
+ 'The "my_type" option must be set'
369
+ );
359
370
}
360
371
361
- $container->setParameter('acme_hello.my_service_type', $config['my_type']);
372
+ $container->setParameter(
373
+ 'acme_hello.my_service_type',
374
+ $config['my_type']
375
+ );
362
376
}
363
377
364
378
Now, the user can effectively configure the service by specifying the ``my_type ``
0 commit comments