NestedEntityStrategy::hydrate()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
declare(strict_types=1);
3
4
namespace SlayerBirden\DataFlowServer\Doctrine\Hydrator\Strategy;
5
6
use Zend\Hydrator\ExtractionInterface;
7
use Zend\Hydrator\Strategy\StrategyInterface;
8
9
final class NestedEntityStrategy implements StrategyInterface
10
{
11
    /**
12
     * @var ExtractionInterface
13
     */
14
    private $extraction;
15
16 88
    public function __construct(ExtractionInterface $extraction)
17
    {
18 88
        $this->extraction = $extraction;
19 88
    }
20
21
    /**
22
     * @inheritdoc
23
     */
24 58
    public function extract($value)
25
    {
26 58
        return $this->extraction->extract($value);
27
    }
28
29
    /**
30
     * @inheritdoc
31
     */
32 18
    public function hydrate($value)
33
    {
34 18
        return $value;
35
    }
36
}
37