Passed
Pull Request — master (#11)
by Joao
02:01
created

JsonOutputProcessor::getDetailedErrorHandler()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace ByJG\RestServer\OutputProcessor;
4
5
use ByJG\RestServer\Whoops\JsonLimitedResponseHandler;
6
use ByJG\Serializer\Formatter\JsonFormatter;
7
use Whoops\Handler\JsonResponseHandler;
8
9
class JsonOutputProcessor extends BaseOutputProcessor
10
{
11 9
    public function __construct()
12
    {
13 9
        $this->contentType = "application/json";
14
    }
15
16
    public function getDetailedErrorHandler()
17
    {
18
        return new JsonResponseHandler();
19
    }
20
21 7
    public function getErrorHandler()
22
    {
23 7
        return new JsonLimitedResponseHandler();
24
    }
25
26 4
    public function getFormatter()
27
    {
28 4
        return new JsonFormatter();
29
    }
30
}
31