RepostOnTimeOutProcessorConfigurator   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 3
dl 0
loc 45
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getProcessorArguments() 0 8 1
A getCommandOptions() 0 4 1
A resolveOptions() 0 4 1
1
<?php
2
3
namespace Dekalee\RedisSwarrotBundle\Configurator;
4
5
use Dekalee\RedisSwarrot\Processor\RepostOnTimeOutProcessor;
6
use Psr\Log\LoggerInterface;
7
use Swarrot\SwarrotBundle\Broker\FactoryInterface;
8
use Swarrot\SwarrotBundle\Processor\ProcessorConfiguratorEnableAware;
9
use Swarrot\SwarrotBundle\Processor\ProcessorConfiguratorExtrasAware;
10
use Swarrot\SwarrotBundle\Processor\ProcessorConfiguratorInterface;
11
use Symfony\Component\Console\Input\InputInterface;
12
13
/**
14
 * Class RepostOnTimeOutProcessorConfigurator
15
 */
16
class RepostOnTimeOutProcessorConfigurator implements ProcessorConfiguratorInterface
17
{
18
    use ProcessorConfiguratorEnableAware, ProcessorConfiguratorExtrasAware;
19
20
    private $factory;
21
    private $logger;
22
23
    /**
24
     * @param FactoryInterface $factory
25
     * @param LoggerInterface  $logger
26
     */
27
    public function __construct(FactoryInterface $factory, LoggerInterface $logger)
28
    {
29
        $this->factory = $factory;
30
        $this->logger = $logger;
31
    }
32
33
    /**
34
     * {@inheritdoc}
35
     */
36
    public function getProcessorArguments(array $options)
37
    {
38
        return [
39
            RepostOnTimeOutProcessor::CLASS,
40
            $this->factory->getMessageProvider($options['queue'], $options['connection']),
41
            $this->logger,
42
        ];
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48
    public function getCommandOptions()
49
    {
50
        return [];
51
    }
52
53
    /**
54
     * {@inheritdoc}
55
     */
56
    public function resolveOptions(InputInterface $input)
57
    {
58
        return $this->getExtras();
59
    }
60
}
61