Passed
Branch master (ed0613)
by Martin
02:38 queued 59s
created

AbstractXmlMapper::cdata()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace KingsonDe\Marshal;
6
7
/**
8
 * Concrete Mapper classes MUST implement a "map" function that must return an array or null.
9
 * The reason of not having an abstract function for the "map" function is type hinting.
10
 */
11
class AbstractXmlMapper extends AbstractMapper {
12
13 1
    protected function attributes(): string {
14 1
        return MarshalXml::ATTRIBUTES_KEY;
15
    }
16
17 1
    protected function data(): string {
18 1
        return MarshalXml::DATA_KEY;
19
    }
20
21 1
    protected function cdata($data): array {
22 1
        return [MarshalXml::CDATA_KEY => $data];
23
    }
24
}
25