Completed
Branch v2.0.0 (f654ea)
by Alexander
01:15
created

PresenterEntity::jsonSerialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 6
Ratio 100 %

Importance

Changes 0
Metric Value
dl 6
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * @author Alexander Torosh <[email protected]>
4
 */
5
6
namespace Core\Domain;
7
8
use JsonSerializable;
9
use Symfony\Component\Serializer\Encoder\JsonEncoder;
10
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
11
use Symfony\Component\Serializer\Serializer;
12
13 View Code Duplication
class PresenterEntity implements JsonSerializable
14
{
15
    public function jsonSerialize()
16
    {
17
        $serializer = new Serializer([new ObjectNormalizer()], [new JsonEncoder()]);
18
19
        return json_decode($serializer->serialize($this, 'json'));
20
    }
21
}
22