Completed
Pull Request — master (#230)
by Adamo
13:08 queued 11s
created

LiipFunctionalTestExtension.php (1 issue)

Labels
Severity

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
/*
4
 * This file is part of the Liip/FunctionalTestBundle
5
 *
6
 * (c) Lukas Kahwe Smith <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Liip\FunctionalTestBundle\DependencyInjection;
13
14
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
15
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
16
use Symfony\Component\DependencyInjection\ContainerBuilder;
17
use Symfony\Component\Config\FileLocator;
18
19
class LiipFunctionalTestExtension extends Extension
20
{
21
    /**
22
     * Loads the services based on your application configuration.
23
     *
24
     * @param array            $configs
25
     * @param ContainerBuilder $container
26
     */
27 2
    public function load(array $configs, ContainerBuilder $container)
28
    {
29 2
        $config = $this->processConfiguration(new Configuration(), $configs);
30
31 2
        $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
32 2
        $loader->load('functional_test.xml');
33 2
        if (interface_exists('Symfony\Component\Validator\Validator\ValidatorInterface')) {
34 2
            $loader->load('validator.xml');
35 2
        }
36
37 2
        foreach ($config as $key => $value) {
38 2
            $container->setParameter($this->getAlias().'.'.$key, $value);
39 2
        }
40
41 2
        $definition = $container->getDefinition('liip_functional_test.query.count_client');
42 2
        if (method_exists($definition, 'setShared')) {
43 2
            $definition->setShared(false);
0 ignored issues
show
The method setShared() does not seem to exist on object<Symfony\Component...cyInjection\Definition>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
44 2
        } else {
45
            $definition->setScope('prototype');
46
        }
47 2
    }
48
}
49