Completed
Pull Request — master (#28)
by Tom
02:34
created

Configurator   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getServiceProvider() 0 4 1
A addConfig() 0 4 1
1
<?php
2
3
namespace TomPHP\ConfigServiceProvider\League;
4
5
use TomPHP\ConfigServiceProvider\ContainerConfigurator;
6
use TomPHP\ConfigServiceProvider\ApplicationConfig;
7
use League\Container\ServiceProvider\AbstractServiceProvider;
8
9
final class Configurator implements ContainerConfigurator
10
{
11
    /** @var ApplicationConfigServiceProvider */
12
    private $provider;
13
14
    public function addConfig(ApplicationConfig $config, $prefix = 'config')
15
    {
16
        $this->provider = new ApplicationConfigServiceProvider($config, $prefix);
17
    }
18
19
    /**
20
     * @internal
21
     *
22
     * @return ServiceProviderInterface
0 ignored issues
show
Documentation introduced by
Should the return type not be ApplicationConfigServiceProvider?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
23
     */
24
    public function getServiceProvider()
25
    {
26
        return $this->provider;
27
    }
28
}
29