Import   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A execute() 0 5 1
A configure() 0 3 1
1
<?php declare(strict_types=1);
2
3
4
namespace App\Backend\Console;
5
6
use App\Backend\Import\PimImport;
7
use Symfony\Component\Console\Command\Command;
8
use Symfony\Component\Console\Input\InputInterface;
9
use Symfony\Component\Console\Output\OutputInterface;
10
11
class Import extends Command
12
{
13
    protected static $defaultName = 'pim:import';
14
15
    /**
16
     * @var \App\Backend\Import\PimImport
17
     */
18
    private $pimImport;
19
20
    /**
21
     * @param \App\Backend\Import\PimImport $pimImport
22
     */
23
    public function __construct(PimImport $pimImport)
24
    {
25
        parent::__construct();
26
        $this->pimImport = $pimImport;
27
    }
28
29
30
    protected function configure() : void
31
    {
32
        $this->setDescription('Import product');
33
    }
34
35
    /**
36
     * @param \Symfony\Component\Console\Input\InputInterface $input
37
     * @param \Symfony\Component\Console\Output\OutputInterface $output
38
     * @return int
39
     */
40
    protected function execute(InputInterface $input, OutputInterface $output) : int
41
    {
42
        $this->pimImport->run();
43
44
        return 0;
45
    }
46
}
47