Completed
Push — master ( 8c5bee...33e30f )
by
unknown
06:57 queued 04:51
created

DependencyInjection/SculpinMarkdownExtension.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is a part of Sculpin.
7
 *
8
 * (c) Dragonfly Development Inc.
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Sculpin\Bundle\MarkdownBundle\DependencyInjection;
15
16
use Symfony\Component\Config\FileLocator;
17
use Symfony\Component\DependencyInjection\ContainerBuilder;
18
use Symfony\Component\DependencyInjection\Loader;
19
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
20
21
/**
22
 * @author Beau Simensen <[email protected]>
23
 */
24 View Code Duplication
class SculpinMarkdownExtension extends Extension
0 ignored issues
show
This class seems to be duplicated in 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...
25
{
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function load(array $configs, ContainerBuilder $container): void
30
    {
31
        $configuration = new Configuration;
32
        $config = $this->processConfiguration($configuration, $configs);
33
34
        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
35
        $loader->load('services.xml');
36
37
        $container->setParameter('sculpin_markdown.parser.class', $config['parser_class']);
38
        $container->setParameter('sculpin_markdown.extensions', $config['extensions']);
39
40
        $container->findDefinition('sculpin_markdown.converter')->addArgument($config['extensions']);
41
    }
42
}
43