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

XMLConfigurator   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 0
cbo 0
dl 0
loc 16
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A configure() 0 13 3
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