ArraySerializer   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 0
dl 0
loc 16
ccs 4
cts 4
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 4 1
getRepresentation() 0 1 ?
A fromArray() 0 4 1
getReverseRepresentation() 0 1 ?
1
<?php
2
namespace einfach\representer\serializer;
3
4
/**
5
 * Class ArraySerializer
6
 *
7
 * @package einfach\representer\serializer
8
 *
9
 */
10
trait ArraySerializer
11
{
12 6
    public function toArray()
13
    {
14 6
        return $this->getRepresentation();
15
    }
16
17 3
    public function fromArray($array)
18
    {
19 3
        return $this->getReverseRepresentation($array);
20
    }
21
22
    protected abstract function getRepresentation();
23
24
    protected abstract function getReverseRepresentation($projection);
25
}
26