Issues (13)

DependencyInjection/FaultToleranceExtension.php (1 issue)

Labels
Severity
1
<?php
2
3
/**
4
 * This file is part of the bugloos/fault-tolerance-bundle project.
5
 * (c) Bugloos <https://bugloos.com/>
6
 * For the full copyright and license information, please view
7
 * the LICENSE file that was distributed with this source code.
8
 */
9
10
namespace Bugloos\FaultToleranceBundle\DependencyInjection;
11
12
use Symfony\Component\Config\FileLocator;
13
use Symfony\Component\DependencyInjection\ContainerBuilder;
14
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
15
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
16
17
/**
18
 * @author Mojtaba Gheytasi <[email protected]>
19
 */
20
class FaultToleranceExtension extends Extension
21
{
22
    public function load(array $configs, ContainerBuilder $container)
23
    {
24
        $configuration = $this->getConfiguration($configs, $container);
25
        $config = $this->processConfiguration($configuration, $configs);
0 ignored issues
show
It seems like $configuration can also be of type null; however, parameter $configuration of Symfony\Component\Depend...:processConfiguration() does only seem to accept Symfony\Component\Config...\ConfigurationInterface, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

25
        $config = $this->processConfiguration(/** @scrutinizer ignore-type */ $configuration, $configs);
Loading history...
26
27
        $container->setParameter('redis_url', $config['redis_url']);
28
        $container->setParameter('mongodb_url', $config['mongodb_url']);
29
30
        $loader = new YamlFileLoader(
31
            $container,
32
            new FileLocator(__DIR__.'/../Resources/config')
33
        );
34
35
        $loader->load('services.yaml');
36
    }
37
38
    public function getAlias(): string
39
    {
40
        return 'bugloos_fault_tolerance';
41
    }
42
}
43