Import   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 33
rs 10
c 0
b 0
f 0

3 Methods

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