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

StartQueueConsumerFactory::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 7
ccs 0
cts 4
cp 0
rs 10
cc 1
nc 1
nop 2
crap 2
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