| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | public function process(ContainerBuilder $container) |
||
| 18 | { |
||
| 19 | $dir = __DIR__ . '/../../../../../app/config'; |
||
| 20 | $fileLocator = new FileLocator($dir); |
||
| 21 | foreach(array('dev', 'prod', 'test') as $environment) { |
||
| 22 | $configFile = $fileLocator->locate('config_' . $environment . '.yml'); |
||
| 23 | $config = Yaml::parse($configFile); |
||
|
|
|||
| 24 | if (isset($config['propel']['dbal'])) { |
||
| 25 | $connectionConfig[$environment] = $config['propel']['dbal']; |
||
| 26 | $connectionConfig[$environment]['adapter'] = $config['propel']['dbal']['driver']; |
||
| 27 | $connectionConfig[$environment]['username'] = $config['propel']['dbal']['user']; |
||
| 28 | } |
||
| 29 | } |
||
| 30 | $definition = $container->getDefinition('connection_config'); |
||
| 31 | $definition->setArguments(array($connectionConfig)); |
||
| 32 | } |
||
| 33 | } |
||
| 34 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.