Import::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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