Test Failed
Pull Request — master (#11)
by Pavel
08:20
created

BuiltinNormalizerAdapter::normalize()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 2
1
<?php
2
3
namespace Bankiru\Api\JsonRpc\Adapters\Builtin;
4
5
use Bankiru\Api\JsonRpc\NormalizerInterface;
6
7
final class BuiltinNormalizerAdapter implements NormalizerInterface
8
{
9
    /** {@inheritdoc} */
10
    public function normalize($entity, array $context = [])
11
    {
12
        if (null === $entity) {
13
            return null;
14
        }
15
16
        return json_decode(json_encode($entity), true);
17
    }
18
}
19