Completed
Push — master ( 0024da...3d898f )
by Oleg
03:17
created

ObscuredStrategy   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 66.67%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 22
ccs 4
cts 6
cp 0.6667
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A extract() 0 8 2
A hydrate() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
namespace SlayerBirden\DataFlowServer\Doctrine\Hydrator\Strategy;
5
6
use Zend\Hydrator\Strategy\StrategyInterface;
7
8
class ObscuredStrategy implements StrategyInterface
9
{
10
    /**
11
     * @inheritdoc
12
     */
13 9
    public function extract($value)
14
    {
15 9
        if ($value !== null) {
16 1
            return '*****';
17
        }
18
19 8
        return $value;
20
    }
21
22
    /**
23
     * @inheritdoc
24
     */
25
    public function hydrate($value)
26
    {
27
        return $value;
28
    }
29
}
30