ArraySerializer::toArray()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 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