Completed
Pull Request — master (#1)
by Woody
27:07 queued 01:07
created

ExceptionHandlerPreferences   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 23
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 17 1
1
<?php
2
3
namespace Equip\Handler;
4
5
use Destrukt\Dictionary;
6
use Whoops\Handler\JsonResponseHandler;
7
use Whoops\Handler\PlainTextHandler;
8
use Whoops\Handler\PrettyPageHandler;
9
use Whoops\Handler\XmlResponseHandler;
10
11
class ExceptionHandlerPreferences extends Dictionary
12
{
13
    /**
14
     * @inheritDoc
15
     */
16 13
    public function __construct(array $data = [])
17
    {
18
        $data += [
19 13
            'text/html' => PrettyPageHandler::class,
20
            'application/javascript' => JsonResponseHandler::class,
21
            'application/json' => JsonResponseHandler::class,
22
            'application/ld+json' => JsonResponseHandler::class,
23
            'application/vnd.api+json' => JsonResponseHandler::class,
24
            'application/vnd.geo+json' => JsonResponseHandler::class,
25
            'application/xml' => XmlResponseHandler::class,
26
            'application/atom+xml' => XmlResponseHandler::class,
27
            'application/rss+xml' => XmlResponseHandler::class,
28
            'text/plain' => PlainTextHandler::class,
29
        ]; // @codeCoverageIgnore
30
31 13
        parent::__construct($data);
32 13
    }
33
}
34