XmlSerializer   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 30
c 0
b 0
f 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getTransformer() 0 4 1
A serialize() 0 4 1
1
<?php
2
3
namespace NilPortugues\Api\Xml;
4
5
use NilPortugues\Api\Mapping\Mapper;
6
use NilPortugues\Serializer\DeepCopySerializer;
7
8
class XmlSerializer extends DeepCopySerializer
9
{
10
    /**
11
     * XmlSerializer constructor.
12
     *
13
     * @param Mapper $mapper
14
     */
15
    public function __construct(Mapper $mapper)
16
    {
17
        parent::__construct(new XmlTransformer($mapper));
18
    }
19
20
    /**
21
     * @return XmlTransformer
22
     */
23
    public function getTransformer()
24
    {
25
        return $this->serializationStrategy;
0 ignored issues
show
Bug Compatibility introduced by
The expression $this->serializationStrategy; of type NilPortugues\Serializer\...r\Strategy\JsonStrategy adds the type NilPortugues\Serializer\Strategy\JsonStrategy to the return on line 25 which is incompatible with the return type documented by NilPortugues\Api\Xml\XmlSerializer::getTransformer of type NilPortugues\Api\Xml\XmlTransformer.
Loading history...
26
    }
27
28
    /**
29
     * @param mixed $value
30
     *
31
     * @return string
32
     */
33
    public function serialize($value)
34
    {
35
        return parent::serialize($value);
36
    }
37
}
38