ProcessCommand::execute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 6
rs 10
cc 1
nc 1
nop 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Setono\SyliusStockMovementPlugin\Command;
6
7
use Setono\SyliusStockMovementPlugin\Processor\ReportConfigurationProcessorInterface;
8
use Symfony\Component\Console\Command\Command;
9
use Symfony\Component\Console\Input\InputInterface;
10
use Symfony\Component\Console\Logger\ConsoleLogger;
11
use Symfony\Component\Console\Output\OutputInterface;
12
13
final class ProcessCommand extends Command
14
{
15
    protected static $defaultName = 'setono:sylius-stock-movement:process';
16
17
    /** @var ReportConfigurationProcessorInterface */
18
    private $processor;
19
20
    public function __construct(ReportConfigurationProcessorInterface $processor)
21
    {
22
        parent::__construct();
23
24
        $this->processor = $processor;
25
    }
26
27
    protected function configure(): void
28
    {
29
        $this->setDescription('Processes report configurations');
30
    }
31
32
    public function execute(InputInterface $input, OutputInterface $output): int
33
    {
34
        $this->processor->setLogger(new ConsoleLogger($output));
35
        $this->processor->process();
36
37
        return 0;
38
    }
39
}
40