Completed
Push — master ( 3b7ffc...93bca7 )
by Łukasz
15:02
created

handleSiteAccessesRelation()   A

Complexity

Conditions 5
Paths 10

Size

Total Lines 32

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 5
nc 10
nop 1
dl 0
loc 32
rs 9.0968
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A EzPublishCoreExtension::handleUrlChecker() 0 4 1
A EzPublishCoreExtension::buildPolicyMap() 0 7 2
1
<?php
2
3
/**
4
 * File containing the EzPublishCoreExtension class.
5
 *
6
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
7
 * @license For full copyright and license information view LICENSE file distributed with this source code.
8
 */
9
namespace eZ\Bundle\EzPublishCoreBundle\DependencyInjection;
10
11
use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler\QueryTypePass;
12
use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigParser;
13
use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\SiteAccessAware\ConfigurationProcessor;
14
use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\Suggestion\Collector\SuggestionCollector;
15
use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\Suggestion\Collector\SuggestionCollectorAwareInterface;
16
use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\Suggestion\Formatter\YamlSuggestionFormatter;
17
use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Security\PolicyProvider\PoliciesConfigBuilder;
18
use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Security\PolicyProvider\PolicyProviderInterface;
19
use eZ\Bundle\EzPublishCoreBundle\SiteAccess\SiteAccessConfigurationFilter;
20
use eZ\Publish\Core\QueryType\QueryType;
21
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
22
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
23
use Symfony\Component\Filesystem\Filesystem;
24
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
25
use Symfony\Component\DependencyInjection\ContainerBuilder;
26
use Symfony\Component\DependencyInjection\Loader;
27
use Symfony\Component\DependencyInjection\Loader\FileLoader;
28
use Symfony\Component\Config\FileLocator;
29
use InvalidArgumentException;
30
use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ParserInterface;
31
32
class EzPublishCoreExtension extends Extension implements PrependExtensionInterface
33
{
34
    /** @var \eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\Suggestion\Collector\SuggestionCollector */
35
    private $suggestionCollector;
36
37
    /** @var \eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ParserInterface */
38
    private $mainConfigParser;
39
40
    /** @var \eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ParserInterface[] */
41
    private $configParsers;
42
43
    /** @var PolicyProviderInterface[] */
44
    private $policyProviders = [];
45
46
    /**
47
     * Holds a collection of YAML files, as an array with directory path as a
48
     * key to the array of contained file names.
49
     *
50
     * @var array
51
     */
52
    private $defaultSettingsCollection = [];
53
54
    /** @var \eZ\Bundle\EzPublishCoreBundle\SiteAccess\SiteAccessConfigurationFilter[] */
55
    private $siteaccessConfigurationFilters = [];
56
57
    public function __construct(array $configParsers = [])
58
    {
59
        $this->configParsers = $configParsers;
60
        $this->suggestionCollector = new SuggestionCollector();
61
    }
62
63
    public function getAlias()
64
    {
65
        return 'ezpublish';
66
    }
67
68
    /**
69
     * Loads a specific configuration.
70
     *
71
     * @param mixed[] $configs An array of configuration values
72
     * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container A ContainerBuilder instance
73
     *
74
     * @throws \InvalidArgumentException When provided tag is not defined in this extension
75
     *
76
     * @api
77
     */
78
    public function load(array $configs, ContainerBuilder $container)
79
    {
80
        $loader = new Loader\YamlFileLoader(
81
            $container,
82
            new FileLocator(__DIR__ . '/../Resources/config')
83
        );
84
85
        $configuration = $this->getConfiguration($configs, $container);
86
87
        // Note: this is where the transformation occurs
88
        $config = $this->processConfiguration($configuration, $configs);
89
90
        // Base services and services overrides
91
        $loader->load('services.yml');
92
        // Security services
93
        $loader->load('security.yml');
94
95
        if (interface_exists('FOS\JsRoutingBundle\Extractor\ExposedRoutesExtractorInterface')) {
96
            $loader->load('routing/js_routing.yml');
97
        }
98
99
        // Default settings
100
        $this->handleDefaultSettingsLoading($container, $loader);
101
102
        $this->registerRepositoriesConfiguration($config, $container);
103
        $this->registerSiteAccessConfiguration($config, $container);
104
        $this->registerImageMagickConfiguration($config, $container);
105
        $this->registerUrlAliasConfiguration($config, $container);
106
        $this->registerUrlWildcardsConfiguration($config, $container);
107
108
        // Routing
109
        $this->handleRouting($config, $container, $loader);
110
        // Public API loading
111
        $this->handleApiLoading($container, $loader);
112
        $this->handleTemplating($container, $loader);
113
        $this->handleSessionLoading($container, $loader);
114
        $this->handleCache($config, $container, $loader);
115
        $this->handleLocale($config, $container, $loader);
116
        $this->handleHelpers($config, $container, $loader);
117
        $this->handleImage($config, $container, $loader);
118
        $this->handleUrlChecker($config, $container, $loader);
119
        $this->handleUrlWildcards($config, $container, $loader);
120
121
        // Map settings
122
        $processor = new ConfigurationProcessor($container, 'ezsettings');
123
        $processor->mapConfig($config, $this->getMainConfigParser());
124
125
        if ($this->suggestionCollector->hasSuggestions()) {
126
            $message = '';
127
            $suggestionFormatter = new YamlSuggestionFormatter();
128
            foreach ($this->suggestionCollector->getSuggestions() as $suggestion) {
129
                $message .= $suggestionFormatter->format($suggestion) . "\n\n";
130
            }
131
132
            throw new InvalidArgumentException($message);
133
        }
134
135
        $this->buildPolicyMap($container);
136
137
        $container->registerForAutoconfiguration(QueryType::class)
138
            ->addTag(QueryTypePass::QUERY_TYPE_SERVICE_TAG);
139
    }
140
141
    /**
142
     * @param array $config
143
     * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
144
     *
145
     * @return \eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration
146
     */
147
    public function getConfiguration(array $config, ContainerBuilder $container)
148
    {
149
        $configuration = new Configuration($this->getMainConfigParser(), $this->suggestionCollector);
150
        $configuration->setSiteAccessConfigurationFilters($this->siteaccessConfigurationFilters);
151
152
        return $configuration;
153
    }
154
155
    /**
156
     * {@inheritdoc}
157
     */
158
    public function prepend(ContainerBuilder $container)
159
    {
160
        $this->prependTranslatorConfiguration($container);
161
    }
162
163
    /**
164
     * @return \eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ParserInterface
165
     */
166
    private function getMainConfigParser()
167
    {
168
        if ($this->mainConfigParser === null) {
169
            foreach ($this->configParsers as $parser) {
170
                if ($parser instanceof SuggestionCollectorAwareInterface) {
171
                    $parser->setSuggestionCollector($this->suggestionCollector);
172
                }
173
            }
174
175
            $this->mainConfigParser = new ConfigParser($this->configParsers);
176
        }
177
178
        return $this->mainConfigParser;
179
    }
180
181
    /**
182
     * Handle default settings.
183
     *
184
     * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
185
     * @param \Symfony\Component\DependencyInjection\Loader\FileLoader $loader
186
     *
187
     * @throws \Exception
188
     */
189
    private function handleDefaultSettingsLoading(ContainerBuilder $container, FileLoader $loader)
190
    {
191
        $loader->load('default_settings.yml');
192
193
        foreach ($this->defaultSettingsCollection as $fileLocation => $files) {
194
            $externalLoader = new Loader\YamlFileLoader($container, new FileLocator($fileLocation));
195
            foreach ($files as $file) {
196
                $externalLoader->load($file);
197
            }
198
        }
199
    }
200
201
    private function registerRepositoriesConfiguration(array $config, ContainerBuilder $container)
202
    {
203
        if (!isset($config['repositories'])) {
204
            $config['repositories'] = [];
205
        }
206
207
        foreach ($config['repositories'] as $name => &$repository) {
208
            if (empty($repository['fields_groups']['list'])) {
209
                $repository['fields_groups']['list'] = $container->getParameter('ezsettings.default.content.field_groups.list');
210
            }
211
        }
212
213
        $container->setParameter('ezpublish.repositories', $config['repositories']);
214
    }
215
216
    private function registerSiteAccessConfiguration(array $config, ContainerBuilder $container)
217
    {
218
        if (!isset($config['siteaccess'])) {
219
            $config['siteaccess'] = [];
220
            $config['siteaccess']['list'] = ['setup'];
221
            $config['siteaccess']['default_siteaccess'] = 'setup';
222
            $config['siteaccess']['groups'] = [];
223
            $config['siteaccess']['match'] = null;
224
        }
225
226
        $container->setParameter('ezpublish.siteaccess.list', $config['siteaccess']['list']);
227
        ConfigurationProcessor::setAvailableSiteAccesses($config['siteaccess']['list']);
228
        $container->setParameter('ezpublish.siteaccess.default', $config['siteaccess']['default_siteaccess']);
229
        $container->setParameter('ezpublish.siteaccess.match_config', $config['siteaccess']['match']);
230
231
        // Register siteaccess groups + reverse
232
        $container->setParameter('ezpublish.siteaccess.groups', $config['siteaccess']['groups']);
233
        $groupsBySiteaccess = [];
234 View Code Duplication
        foreach ($config['siteaccess']['groups'] as $groupName => $groupMembers) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
235
            foreach ($groupMembers as $member) {
236
                if (!isset($groupsBySiteaccess[$member])) {
237
                    $groupsBySiteaccess[$member] = [];
238
                }
239
240
                $groupsBySiteaccess[$member][] = $groupName;
241
            }
242
        }
243
        $container->setParameter('ezpublish.siteaccess.groups_by_siteaccess', $groupsBySiteaccess);
244
        ConfigurationProcessor::setGroupsBySiteAccess($groupsBySiteaccess);
245
    }
246
247
    private function registerImageMagickConfiguration(array $config, ContainerBuilder $container)
248
    {
249
        if (isset($config['imagemagick'])) {
250
            $container->setParameter('ezpublish.image.imagemagick.enabled', $config['imagemagick']['enabled']);
251
            if ($config['imagemagick']['enabled']) {
252
                $container->setParameter('ezpublish.image.imagemagick.executable_path', dirname($config['imagemagick']['path']));
253
                $container->setParameter('ezpublish.image.imagemagick.executable', basename($config['imagemagick']['path']));
254
            }
255
        }
256
257
        $filters = isset($config['imagemagick']['filters']) ? $config['imagemagick']['filters'] : [];
258
        $filters = $filters + $container->getParameter('ezpublish.image.imagemagick.filters');
259
        $container->setParameter('ezpublish.image.imagemagick.filters', $filters);
260
    }
261
262
    /**
263
     * Handle routing parameters.
264
     *
265
     * @param array $config
266
     * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
267
     * @param \Symfony\Component\DependencyInjection\Loader\FileLoader $loader
268
     */
269
    private function handleRouting(array $config, ContainerBuilder $container, FileLoader $loader)
270
    {
271
        $loader->load('routing.yml');
272
        $container->setAlias('router', 'ezpublish.chain_router');
273
        $container->getAlias('router')->setPublic(true);
274
275
        if (isset($config['router']['default_router']['non_siteaccess_aware_routes'])) {
276
            $container->setParameter(
277
                'ezpublish.default_router.non_siteaccess_aware_routes',
278
                array_merge(
279
                    $container->getParameter('ezpublish.default_router.non_siteaccess_aware_routes'),
280
                    $config['router']['default_router']['non_siteaccess_aware_routes']
281
                )
282
            );
283
        }
284
    }
285
286
    /**
287
     * Handle public API loading.
288
     *
289
     * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
290
     * @param \Symfony\Component\DependencyInjection\Loader\FileLoader $loader
291
     */
292
    private function handleApiLoading(ContainerBuilder $container, FileLoader $loader)
293
    {
294
        // Loading configuration from Core/settings
295
        $coreLoader = new Loader\YamlFileLoader(
296
            $container,
297
            new FileLocator(__DIR__ . '/../../../Publish/Core/settings')
298
        );
299
        $coreLoader->load('repository.yml');
300
        $coreLoader->load('repository/inner.yml');
301
        $coreLoader->load('repository/event.yml');
302
        $coreLoader->load('repository/siteaccessaware.yml');
303
        $coreLoader->load('repository/autowire.yml');
304
        $coreLoader->load('fieldtype_external_storages.yml');
305
        $coreLoader->load('fieldtypes.yml');
306
        $coreLoader->load('indexable_fieldtypes.yml');
307
        $coreLoader->load('fieldtype_services.yml');
308
        $coreLoader->load('roles.yml');
309
        $coreLoader->load('storage_engines/common.yml');
310
        $coreLoader->load('storage_engines/cache.yml');
311
        $coreLoader->load('storage_engines/legacy.yml');
312
        $coreLoader->load('storage_engines/shortcuts.yml');
313
        $coreLoader->load('search_engines/common.yml');
314
        $coreLoader->load('utils.yml');
315
        $coreLoader->load('io.yml');
316
        $coreLoader->load('policies.yml');
317
        $coreLoader->load('notification.yml');
318
        $coreLoader->load('user_preference.yml');
319
        $coreLoader->load('events.yml');
320
        $coreLoader->load('thumbnails.yml');
321
322
        // Public API services
323
        $loader->load('papi.yml');
324
325
        // Built-in field types
326
        $loader->load('fieldtype_services.yml');
327
328
        // Storage engine
329
        $loader->load('storage_engines.yml');
330
    }
331
332
    /**
333
     * Handle templating parameters.
334
     *
335
     * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
336
     * @param \Symfony\Component\DependencyInjection\Loader\FileLoader $loader
337
     */
338
    private function handleTemplating(ContainerBuilder $container, FileLoader $loader)
0 ignored issues
show
Unused Code introduced by
The parameter $container is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
339
    {
340
        $loader->load('templating.yml');
341
    }
342
343
    /**
344
     * Handle session parameters.
345
     *
346
     * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
347
     * @param \Symfony\Component\DependencyInjection\Loader\FileLoader $loader
348
     */
349
    private function handleSessionLoading(ContainerBuilder $container, FileLoader $loader)
0 ignored issues
show
Unused Code introduced by
The parameter $container is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
350
    {
351
        $loader->load('session.yml');
352
    }
353
354
    /**
355
     * Handle cache parameters.
356
     *
357
     * @param array $config
358
     * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
359
     * @param \Symfony\Component\DependencyInjection\Loader\FileLoader $loader
360
     *
361
     * @throws \InvalidArgumentException
362
     */
363
    private function handleCache(array $config, ContainerBuilder $container, FileLoader $loader)
364
    {
365
        $loader->load('cache.yml');
366
367
        $purgeService = null;
0 ignored issues
show
Unused Code introduced by
$purgeService is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
368
        if (isset($config['http_cache']['purge_type'])) {
369
            $container->setParameter('ezpublish.http_cache.purge_type', $config['http_cache']['purge_type']);
370
        }
371
    }
372
373
    /**
374
     * Handle locale parameters.
375
     *
376
     * @param array $config
377
     * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
378
     * @param \Symfony\Component\DependencyInjection\Loader\FileLoader $loader
379
     */
380
    private function handleLocale(array $config, ContainerBuilder $container, FileLoader $loader)
381
    {
382
        $loader->load('locale.yml');
383
        $container->setParameter(
384
            'ezpublish.locale.conversion_map',
385
            $config['locale_conversion'] + $container->getParameter('ezpublish.locale.conversion_map')
386
        );
387
    }
388
389
    /**
390
     * Handle helpers.
391
     *
392
     * @param array $config
393
     * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
394
     * @param \Symfony\Component\DependencyInjection\Loader\FileLoader $loader
395
     */
396
    private function handleHelpers(array $config, ContainerBuilder $container, FileLoader $loader)
0 ignored issues
show
Unused Code introduced by
The parameter $config is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $container is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
397
    {
398
        $loader->load('helpers.yml');
399
    }
400
401
    /**
402
     * @param array $config
403
     * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
404
     * @param \Symfony\Component\DependencyInjection\Loader\FileLoader $loader
405
     */
406
    private function handleImage(array $config, ContainerBuilder $container, FileLoader $loader)
407
    {
408
        $loader->load('image.yml');
409
410
        $providers = [];
411
        if (isset($config['image_placeholder'])) {
412
            foreach ($config['image_placeholder'] as $name => $value) {
413
                if (isset($providers[$name])) {
414
                    throw new InvalidConfigurationException("An image_placeholder called $name already exists");
415
                }
416
417
                $providers[$name] = $value;
418
            }
419
        }
420
421
        $container->setParameter('image_alias.placeholder_providers', $providers);
422
    }
423
424
    private function handleUrlChecker($config, ContainerBuilder $container, FileLoader $loader)
0 ignored issues
show
Unused Code introduced by
The parameter $config is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $container is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
425
    {
426
        $loader->load('url_checker.yml');
427
    }
428
429
    private function buildPolicyMap(ContainerBuilder $container)
430
    {
431
        $policiesBuilder = new PoliciesConfigBuilder($container);
432
        foreach ($this->policyProviders as $provider) {
433
            $provider->addPolicies($policiesBuilder);
434
        }
435
    }
436
437
    /**
438
     * Adds a new policy provider to the internal collection.
439
     * One can call this method from a bundle `build()` method.
440
     *
441
     * ```php
442
     * public function build(ContainerBuilder $container)
443
     * {
444
     *     $ezExtension = $container->getExtension('ezpublish');
445
     *     $ezExtension->addPolicyProvider($myPolicyProvider);
446
     * }
447
     * ```
448
     *
449
     * @since 6.0
450
     *
451
     * @param PolicyProviderInterface $policyProvider
452
     */
453
    public function addPolicyProvider(PolicyProviderInterface $policyProvider)
454
    {
455
        $this->policyProviders[] = $policyProvider;
456
    }
457
458
    /**
459
     * Adds a new config parser to the internal collection.
460
     * One can call this method from a bundle `build()` method.
461
     *
462
     * ```php
463
     * public function build(ContainerBuilder $container)
464
     * {
465
     *     $ezExtension = $container->getExtension('ezpublish');
466
     *     $ezExtension->addConfigParser($myConfigParser);
467
     * }
468
     * ```
469
     *
470
     * @since 6.0
471
     *
472
     * @param \eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ParserInterface $configParser
473
     */
474
    public function addConfigParser(ParserInterface $configParser)
475
    {
476
        $this->configParsers[] = $configParser;
477
    }
478
479
    /**
480
     * Adds new default settings to the internal collection.
481
     * One can call this method from a bundle `build()` method.
482
     *
483
     * ```php
484
     * public function build(ContainerBuilder $container)
485
     * {
486
     *     $ezExtension = $container->getExtension('ezpublish');
487
     *     $ezExtension->addDefaultSettings(
488
     *         __DIR__ . '/Resources/config',
489
     *         ['default_settings.yml']
490
     *     );
491
     * }
492
     * ```
493
     *
494
     * @since 6.0
495
     *
496
     * @param string $fileLocation
497
     * @param array $files
498
     */
499
    public function addDefaultSettings($fileLocation, array $files)
500
    {
501
        $this->defaultSettingsCollection[$fileLocation] = $files;
502
    }
503
504
    public function addSiteAccessConfigurationFilter(SiteAccessConfigurationFilter $filter)
505
    {
506
        $this->siteaccessConfigurationFilters[] = $filter;
507
    }
508
509
    /**
510
     * @param array $config
511
     * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
512
     */
513
    private function registerUrlAliasConfiguration(array $config, ContainerBuilder $container)
514
    {
515
        if (!isset($config['url_alias'])) {
516
            $config['url_alias'] = ['slug_converter' => []];
517
        }
518
519
        $container->setParameter('ezpublish.url_alias.slug_converter', $config['url_alias']['slug_converter']);
520
    }
521
522
    /**
523
     * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
524
     */
525
    private function prependTranslatorConfiguration(ContainerBuilder $container)
526
    {
527
        if (!$container->hasExtension('framework')) {
528
            return;
529
        }
530
531
        $fileSystem = new Filesystem();
532
        $translationsPath = $container->getParameterBag()->get('kernel.root_dir') . '/../vendor/ezplatform-i18n';
533
534
        if ($fileSystem->exists($translationsPath)) {
535
            $container->prependExtensionConfig('framework', ['translator' => ['paths' => [$translationsPath]]]);
536
        }
537
    }
538
539
    /**
540
     * @param array $config
541
     * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
542
     */
543
    private function registerUrlWildcardsConfiguration(array $config, ContainerBuilder $container): void
544
    {
545
        $container->setParameter('ezpublish.url_wildcards.enabled', $config['url_wildcards']['enabled'] ?? false);
546
    }
547
548
    /**
549
     * Loads configuration for UrlWildcardsRouter service if enabled.
550
     *
551
     * @param array $config
552
     * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
553
     * @param \Symfony\Component\DependencyInjection\Loader\FileLoader $loader
554
     */
555
    private function handleUrlWildcards(array $config, ContainerBuilder $container, Loader\YamlFileLoader $loader)
0 ignored issues
show
Unused Code introduced by
The parameter $config is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
556
    {
557
        if ($container->getParameter('ezpublish.url_wildcards.enabled')) {
558
            $loader->load('url_wildcard.yml');
559
        }
560
    }
561
}
562