Completed
Push — master ( 5e4c69...6bf127 )
by Tom
02:18
created

Configurator   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A addApplicationConfig() 0 4 1
A addServiceConfig() 0 4 1
A addInflectorConfig() 0 4 1
A getServiceProvider() 0 4 1
1
<?php
2
3
namespace TomPHP\ConfigServiceProvider\League;
4
5
use League\Container\ServiceProvider\ServiceProviderInterface;
6
use TomPHP\ConfigServiceProvider\ApplicationConfig;
7
use TomPHP\ConfigServiceProvider\ContainerConfigurator;
8
use TomPHP\ConfigServiceProvider\InflectorConfig;
9
use TomPHP\ConfigServiceProvider\ServiceConfig;
10
11
final class Configurator implements ContainerConfigurator
12
{
13
    /**
14
     * @var ServiceProviderInterface[]
15
     */
16
    private $providers = [];
17
18
    public function addApplicationConfig(ApplicationConfig $config, $prefix = 'config')
19
    {
20
        $this->providers[] = new ApplicationConfigServiceProvider($config, $prefix);
21
    }
22
23
    public function addServiceConfig(ServiceConfig $config)
24
    {
25
        $this->providers[] = new ServiceServiceProvider($config);
26
    }
27
28
    public function addInflectorConfig(InflectorConfig $config)
29
    {
30
        $this->providers[] = new InflectorServiceProvider($config);
31
    }
32
33
    /**
34
     * @internal
35
     *
36
     * @return ServiceProviderInterface
37
     */
38
    public function getServiceProvider()
39
    {
40
        return new AggregateServiceProvider($this->providers);
41
    }
42
}
43