LicenseResponder::isBinaryResponder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Usox\HyperSonic\FeatureSet\V1161\Responder;
6
7
use AaronDDM\XMLBuilder\XMLArray;
8
use Usox\HyperSonic\Response\FormattedResponderInterface;
9
10
final class LicenseResponder implements FormattedResponderInterface
11
{
12
    /**
13
     * @param array{
14
     *  valid: string,
15
     *  email: string,
16
     *  licenseExpires: string
17
     * } $licenseData
18
     */
19 4
    public function __construct(
20
        private readonly array $licenseData
21
    ) {
22 4
    }
23
24 1
    public function writeXml(XMLArray $XMLArray): void
25
    {
26 1
        $XMLArray->add(
27 1
            'license',
28 1
            null,
29 1
            $this->licenseData
30 1
        );
31
    }
32
33 1
    public function writeJson(array &$root): void
34
    {
35 1
        $root['license'] = $this->licenseData;
36
    }
37
38 1
    public function isBinaryResponder(): bool
39
    {
40 1
        return false;
41
    }
42
}
43