JMSSerializerAdapter   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 17
ccs 0
cts 6
cp 0
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A serialize() 0 3 1
A __construct() 0 3 1
A deserialize() 0 3 1
1
<?php declare(strict_types=1);
2
/**
3
 * This file is part of the daikon-cqrs/boot project.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
namespace Daikon\Boot\Serializer;
10
11
use Daikon\Boot\Middleware\Action\SerializerInterface;
12
use JMS\Serializer\SerializerInterface as JMSSerializerInterface;
13
14
final class JMSSerializerAdapter implements SerializerInterface
15
{
16
    private JMSSerializerInterface $serializer;
17
18
    public function __construct(JMSSerializerInterface $serializer)
19
    {
20
        $this->serializer = $serializer;
21
    }
22
23
    public function serialize($data, $format, $context = null, $type = null)
24
    {
25
        return $this->serializer->serialize($data, $format, $context, $type);
26
    }
27
28
    public function deserialize($data, $type, $format, $context = null)
29
    {
30
        return $this->serializer->deserialize($data, $type, $format, $context);
31
    }
32
}
33