JsonOutputProcessor   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 15
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getFormatter() 0 3 1
A getErrorHandler() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
namespace ByJG\RestServer\OutputProcessor;
4
5
use ByJG\RestServer\Whoops\JsonResponseErrorHandler;
6
use ByJG\Serializer\Formatter\JsonFormatter;
7
8
class JsonOutputProcessor extends BaseOutputProcessor
9
{
10 8
    public function __construct()
11
    {
12 8
        $this->contentType = "application/json";
13 8
    }
14
15 6
    public function getErrorHandler()
16
    {
17 6
        return new JsonResponseErrorHandler();
18
    }
19
20 4
    public function getFormatter()
21
    {
22 4
        return new JsonFormatter();
23
    }
24
}
25