Completed
Push — master ( 3eb757...3bc7c8 )
by Oleg
03:46
created

PermissionHydratorFactory::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 3
crap 1
1
<?php
2
declare(strict_types=1);
3
4
namespace SlayerBirden\DataFlowServer\Authorization\Factory;
5
6
use Interop\Container\ContainerInterface;
7
use SlayerBirden\DataFlowServer\Doctrine\Hydrator\Strategy\NestedEntityStrategy;
8
use Zend\Hydrator\ClassMethods;
9
use Zend\ServiceManager\Factory\FactoryInterface;
10
11
final class PermissionHydratorFactory implements FactoryInterface
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16 10
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
17
    {
18 10
        $hydrator = new ClassMethods();
19 10
        $hydrator->addStrategy('user', new NestedEntityStrategy(new ClassMethods()));
20
21 10
        return $hydrator;
22
    }
23
}
24