JsonOutputProcessor   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 20
ccs 6
cts 8
cp 0.75
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getFormatter() 0 3 1
A getErrorHandler() 0 3 1
A getDetailedErrorHandler() 0 3 1
A __construct() 0 3 1
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 14
    public function __construct()
12
    {
13 14
        $this->contentType = "application/json";
14
    }
15
16
    public function getDetailedErrorHandler()
17
    {
18
        return new JsonResponseHandler();
19
    }
20
21 12
    public function getErrorHandler()
22
    {
23 12
        return new JsonLimitedResponseHandler();
24
    }
25
26 11
    public function getFormatter()
27
    {
28 11
        return new JsonFormatter();
29
    }
30
}
31