Passed
Push — 10.x ( f9701d )
by Tim
04:36
created

ImportCreateOkFileCommand::execute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 8
ccs 0
cts 4
cp 0
crap 2
rs 10
1
<?php
2
3
/**
4
 * TechDivision\Import\Cli\Command\ImportCreateOkFileCommand
5
 *
6
 * NOTICE OF LICENSE
7
 *
8
 * This source file is subject to the Open Software License (OSL 3.0)
9
 * that is available through the world-wide-web at this URL:
10
 * http://opensource.org/licenses/osl-3.0.php
11
 *
12
 * PHP version 5
13
 *
14
 * @author    Tim Wagner <[email protected]>
15
 * @copyright 2016 TechDivision GmbH <[email protected]>
16
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
 * @link      https://github.com/techdivision/import-cli-simple
18
 * @link      http://www.techdivision.com
19
 */
20
21
namespace TechDivision\Import\Cli\Command;
22
23
use Symfony\Component\Console\Input\InputArgument;
24
use TechDivision\Import\Utils\CommandNames;
25
26
/**
27
 * The command implementation that creates a OK file from a directory with CSV files.
28
 *
29
 * @author    Tim Wagner <[email protected]>
30
 * @copyright 2016 TechDivision GmbH <[email protected]>
31
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
32
 * @link      https://github.com/techdivision/import-cli-simple
33
 * @link      http://www.techdivision.com
34
 */
35
class ImportCreateOkFileCommand extends AbstractImportCommand
36
{
37
38
    /**
39
     * Configures the current command.
40
     *
41
     * @return void
42
     * @see \Symfony\Component\Console\Command\Command::configure()
43
     */
44
    protected function configure()
45
    {
46
47
        // initialize the command with the required/optional options
48
        $this->setName(CommandNames::IMPORT_CREATE_OK_FILE)
49
            ->addArgument(InputArgumentKeys::SHORTCUT, InputArgument::OPTIONAL, 'The shortcut that defines the operation(s) that has to be used for the import, one of "create-ok-files" or a combination of them', 'create-ok-files')
50
            ->setDescription('Create\'s the OK file for the CSV files of the configured source directory');
51
52
        // invoke the parent method
53
        parent::configure();
54
    }
55
}
56