Completed
Pull Request — master (#33)
by Tom
02:24
created

Configurator::setContainer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace TomPHP\ConfigServiceProvider\League;
4
5
use League\Container\Container;
6
use TomPHP\ConfigServiceProvider\ApplicationConfig;
7
use TomPHP\ConfigServiceProvider\Configurator as ConfiguratorInterface;
8
use TomPHP\ConfigServiceProvider\InflectorConfig;
9
use TomPHP\ConfigServiceProvider\ServiceConfig;
10
11
final class Configurator implements ConfiguratorInterface
12
{
13
    /**
14
     * @var Container
15
     */
16
    private $container;
17
18
    /**
19
     * @param Container $container
20
     */
21
    public function setContainer($container)
22
    {
23
        $this->container = $container;
24
    }
25
26
    public function addApplicationConfig(ApplicationConfig $config, $prefix = 'config')
27
    {
28
        $this->container->addServiceProvider(new ApplicationConfigServiceProvider($config, $prefix));
29
    }
30
31
    public function addServiceConfig(ServiceConfig $config)
32
    {
33
        $this->container->addServiceProvider(new ServiceServiceProvider($config));
34
    }
35
36
    public function addInflectorConfig(InflectorConfig $config)
37
    {
38
        $this->container->addServiceProvider(new InflectorServiceProvider($config));
39
    }
40
}
41