Passed
Push — master ( 17b9f0...6c0286 )
by Mr
02:04
created

JMSSerializerAdapter   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 17
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;
0 ignored issues
show
Bug introduced by
The type JMS\Serializer\SerializerInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
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