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

PermissionHydratorFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 7 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