Passed
Push — main ( a2d9fb...be9758 )
by Daniel
02:34
created

ResponseWriterFactory::createXmlResponseWriter()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 8
ccs 4
cts 4
cp 1
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Usox\HyperSonic\Response;
6
7
use AaronDDM\XMLBuilder\Writer\XMLWriterService;
8
use AaronDDM\XMLBuilder\XMLBuilder;
9
10
final class ResponseWriterFactory implements ResponseWriterFactoryInterface
11
{
12 1
    public function createXmlResponseWriter(
13
        string $apiVersion
14
    ): ResponseWriterInterface {
15 1
        return new XmlResponseWriter(
16 1
            new XMLBuilder(
17 1
                new XMLWriterService()
18
            ),
19
            $apiVersion,
20
        );
21
    }
22
23 1
    public function createJsonResponseWriter(
24
        string $apiVersion
25
    ): ResponseWriterInterface {
26 1
        return new JsonResponseWriter(
27
            $apiVersion
28
        );
29
    }
30
}
31