Passed
Push — master ( eb5cf9...d1e5fa )
by Al3x
02:01 queued 24s
created

ReflectionHydratorFactory::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
c 0
b 0
f 0
nc 1
nop 3
dl 0
loc 5
ccs 4
cts 4
cp 1
crap 1
rs 10
1
<?php
2
declare(strict_types=1);
3
4
namespace InvoiceNinjaModule\Hydrator;
5
6
use Interop\Container\ContainerInterface;
7
use Laminas\Hydrator\NamingStrategy\UnderscoreNamingStrategy;
8
use Laminas\Hydrator\ReflectionHydrator;
9
use Laminas\ServiceManager\Factory\FactoryInterface;
10
11
/**
12
 * Class ReflectionHydratorFactory
13
 */
14
final class ReflectionHydratorFactory implements FactoryInterface
15
{
16 1
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
17
    {
18 1
        $hydrator = new ReflectionHydrator();
19 1
        $hydrator->setNamingStrategy(new UnderscoreNamingStrategy());
20 1
        return $hydrator;
21
    }
22
}
23