ContentNegotiationServiceProvider::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 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