Passed
Push — master ( 0fb020...8e97d3 )
by Joachim
02:40
created

DispatchCommand::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Setono\MessageSchedulerBundle\Command;
6
7
use Setono\MessageSchedulerBundle\Dispatcher\DispatcherInterface;
8
use Symfony\Component\Console\Command\Command;
9
use Symfony\Component\Console\Input\InputInterface;
10
use Symfony\Component\Console\Output\OutputInterface;
11
12
final class DispatchCommand extends Command
13
{
14
    protected static $defaultName = 'setono:message-scheduler:dispatch';
15
16
    private DispatcherInterface $dispatcher;
17
18 1
    public function __construct(DispatcherInterface $dispatcher)
19
    {
20 1
        parent::__construct();
21
22 1
        $this->dispatcher = $dispatcher;
23 1
    }
24
25 1
    protected function configure(): void
26
    {
27 1
        $this->setDescription('Will dispatch messages, that are eligible for dispatching');
28 1
    }
29
30
    protected function execute(InputInterface $input, OutputInterface $output): int
31
    {
32
        $this->dispatcher->dispatch();
33
34
        return 0;
35
    }
36
}
37