YamlFormat   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 12
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A serialize() 0 4 1
A unserialize() 0 4 1
1
<?php
2
namespace Thunder\Serializard\Format;
3
4
use Symfony\Component\Yaml\Yaml;
5
use Thunder\Serializard\NormalizerContainer\NormalizerContainerInterface as Normalizers;
6
use Thunder\Serializard\HydratorContainer\HydratorContainerInterface as Hydrators;
7
use Thunder\Serializard\NormalizerContext\NormalizerContextInterface;
8
9
/**
10
 * @author Tomasz Kowalczyk <[email protected]>
11
 */
12
final class YamlFormat extends AbstractFormat
13
{
14 2
    public function serialize($var, Normalizers $normalizers, NormalizerContextInterface $context)
15
    {
16 2
        return Yaml::dump($this->doSerialize($var, $normalizers, $context), 2, 2);
17
    }
18
19 1
    public function unserialize($var, $class, Hydrators $hydrators)
20
    {
21 1
        return $this->doUnserialize(Yaml::parse($var), $class, $hydrators);
22
    }
23
}
24