Completed
Push — master ( 638941...47944c )
by Vitaly
04:32
created

XMLConfigurator::configure()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 13
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 13
rs 9.4285
cc 3
eloc 7
nc 3
nop 1
1
<?php declare(strict_types = 1);
2
/**
3
 * Created by Vitaly Iegorov <[email protected]>.
4
 * on 14.08.16 at 15:55
5
 */
6
namespace samsonframework\container\configurator;
7
8
/**
9
 * XML dependency injection container configuration.
10
 * @author Vitaly Iegorov <[email protected]>
11
 * @author Ruslan Molodyko  <[email protected]>
12
 */
13
class XMLConfigurator
14
{
15
    public function configure(string $configuration)
0 ignored issues
show
Unused Code introduced by
The parameter $configuration 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...
16
    {
17
        $configString = file_get_contents(__DIR__ . '/../../../app/config/prod.xml');
18
        $config = new \SimpleXMLElement($configString);
19
20
        // Find all configuration classes
21
        $configData = [];
22
        foreach ($config->container as $service) {
23
            foreach ($service as $serviceName => $configuration) {
24
                $configData[$serviceName] = (array)$configuration;
25
            }
26
        }
27
    }
28
}
29