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

XmlOutputProcessor   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 50%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getDetailedErrorHandler() 0 3 1
A getFormatter() 0 3 1
A getErrorHandler() 0 3 1
1
<?php
2
3
namespace ByJG\RestServer\OutputProcessor;
4
5
use ByJG\Serializer\Formatter\XmlFormatter;
6
use Whoops\Handler\XmlResponseHandler;
7
8
class XmlOutputProcessor extends BaseOutputProcessor
9
{
10 1
    public function __construct()
11
    {
12 1
        $this->contentType = "text/xml";
13
    }
14
15
    public function getDetailedErrorHandler()
16
    {
17
        return new XmlResponseHandler();
18
    }
19
20
    public function getErrorHandler()
21
    {
22
        return $this->getDetailedErrorHandler();
23
    }
24
25 1
    public function getFormatter()
26
    {
27 1
        return new XmlFormatter();
28
    }
29
}
30