This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
21
{
22
/**
23
* @var JmsSerializer
24
*/
25
private $target;
26
27
/**
28
* JmsSerializerAdapter constructor.
29
*
30
* @param JmsSerializer $target
31
*/
32
public function __construct(JmsSerializer $target)
33
{
34
$this->target = $target;
35
}
36
37
/**
38
* @param mixed $data any data
39
* @param Specification $specification
40
*
41
* @return string
42
*/
43
public function serialize($data, Specification $specification): string
44
{
45
return $this->target->serialize($data, 'json');
46
}
47
48
/**
49
* Deserializes data into the given type.
50
*
51
* @param mixed $data
52
* @param string $type
53
* @param Specification $specification
54
*
55
* @return array|object
56
*/
57
public function deserialize($data, string $type, Specification $specification)
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.