Completed
Push — master ( 178a08...5c0b6f )
by Oleg
05:22
created

TokenResourceMiddlewareFactory::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 6
cts 6
cp 1
rs 9.9666
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\Authentication\Factory;
5
6
use Doctrine\ORM\EntityManager;
7
use Interop\Container\ContainerInterface;
8
use Psr\Log\LoggerInterface;
9
use SlayerBirden\DataFlowServer\Authentication\Entities\Token;
10
use SlayerBirden\DataFlowServer\Doctrine\Middleware\BaseResourceMiddleware;
11
use Zend\ServiceManager\Factory\FactoryInterface;
12
13
class TokenResourceMiddlewareFactory implements FactoryInterface
14
{
15
    /**
16
     * @inheritdoc
17
     */
18 3
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
19
    {
20 3
        return new BaseResourceMiddleware(
21 3
            $container->get(EntityManager::class),
22 3
            $container->get(LoggerInterface::class),
23 3
            Token::class,
24 3
            'token'
25
        );
26
    }
27
}
28