Passed
Push — master ( 6627c9...55f346 )
by Pedro
02:07
created

BotParserCacheFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 5
dl 0
loc 13
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 11 1
1
<?php
2
namespace Application\Service\Factory;
3
4
use Zend\ServiceManager\Factory\FactoryInterface;
5
use Interop\Container\ContainerInterface;
6
use Application\Service\BotParser;
7
use Application\Service\BotParserCache;
8
9
class BotParserCacheFactory implements FactoryInterface
10
{
11
    public function __invoke(
12
        ContainerInterface $container,
13
        $requestedName,
14
        array $options = null
15
    ) {
16
        $parser = $container->get(BotParser::class);
17
18
        $cache = $container->get('Cache');
19
        $cache->clearExpired();
20
21
        return new BotParserCache($parser, $cache);
22
    }
23
}
24