HydrationStrategy   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A extract() 0 6 2
A hydrate() 0 4 1
1
<?php
2
3
namespace Pgs\ElasticOM\Hydrator;
4
5
use Zend\Hydrator\Strategy\StrategyInterface;
6
7
class HydrationStrategy implements StrategyInterface
8
{
9
    /** @var Hydrator */
10
    protected $hydrator;
11
12 3
    public function __construct(Hydrator $hydrator)
13
    {
14 3
        $this->hydrator = $hydrator;
15 3
    }
16
17 2
    public function extract($value)
18
    {
19 2
        return is_object($value)
20 1
            ? $this->hydrator->extract($value, false)
21 2
            : $value;
22
    }
23
24 1
    public function hydrate($value)
25
    {
26 1
        return $value;
27
    }
28
}
29