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

AbstractXmlMapper   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 14
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A attributes() 0 3 1
A data() 0 3 1
A cdata() 0 3 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