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

ObscuredStrategy::extract()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 2
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