ProcessCommand   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 9
c 1
b 0
f 0
dl 0
loc 25
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 3 1
A __construct() 0 5 1
A execute() 0 6 1
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