Passed
Push — master ( 80dcb0...573250 )
by Koldo
02:30
created

StartQueueConsumerFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 4
c 1
b 0
f 0
dl 0
loc 9
ccs 0
cts 4
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Antidot\Queue\Container;
6
7
use Antidot\Queue\Cli\StartQueueConsumer;
8
use Antidot\Queue\Container\Config\ConfigProvider;
9
use Enqueue\Consumption\QueueConsumerInterface;
10
use Psr\Container\ContainerInterface;
11
12
class StartQueueConsumerFactory
13
{
14
    public function __invoke(
15
        ContainerInterface $container,
16
        string $contextName = ConfigProvider::DEFAULT_CONTEXT
17
    ): StartQueueConsumer {
18
        return new StartQueueConsumer(
19
            $container->get(QueueConsumerInterface::class),
20
            $container->get($contextName . '.action.container')
21
        );
22
    }
23
}
24