Import::execute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
3
/**
4
 * This file is part of the Setup package.
5
 *
6
 * (c) Sitewards GmbH
7
 */
8
9
namespace Sitewards\Setup\Command\Page;
10
11
use Sitewards\Setup\Service\Page\ImporterInterface;
12
use Symfony\Component\Console\Command\Command;
13
use Symfony\Component\Console\Input\InputInterface;
14
use Symfony\Component\Console\Output\OutputInterface;
15
16
final class Import extends Command
17
{
18
    /** @var ImporterInterface */
19
    private $importer;
20
21
    /**
22
     * @param ImporterInterface $importer
23
     */
24
    public function __construct(ImporterInterface $importer)
25
    {
26
        parent::__construct();
27
28
        $this->importer = $importer;
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    protected function configure()
35
    {
36
        $this
37
            ->setName('page:import')
38
            ->setDescription('Import page(s) from JSON format');
39
    }
40
41
    /**
42
     * {@inheritdoc}
43
     */
44
    protected function execute(InputInterface $input, OutputInterface $output)
45
    {
46
        $this->importer->execute();
47
    }
48
}
49