ContentNegotiationServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 22
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A register() 0 5 1
A boot() 0 3 1
1
<?php
2
3
namespace Dafiti\Silex;
4
5
use Silex\ServiceProviderInterface;
6
use Silex\Application;
7
use Dafiti\Silex\Listener\Header as HeaderListener;
8
use Dafiti\Silex\Listener\Response as ResponseListener;
9
10
class ContentNegotiationServiceProvider implements ServiceProviderInterface
11
{
12
    /**
13
     * @var array
14
     */
15
    private $config;
16
17
    public function __construct(array $config)
18
    {
19
        $this->config = $config;
20
    }
21
22
    public function register(Application $app)
23
    {
24
        $app['dispatcher']->addSubscriber(HeaderListener::create($this->config));
25
        $app['dispatcher']->addSubscriber(new ResponseListener());
26
    }
27
28
    public function boot(Application $app)
29
    {
30
    }
31
}
32