Code Duplication    Length = 23-30 lines in 2 locations

Command/IndexCreateCommand.php 1 location

@@ 30-52 (lines=23) @@
27
    /**
28
     * {@inheritdoc}
29
     */
30
    protected function configure()
31
    {
32
        parent::configure();
33
34
        $this
35
            ->setName(static::$defaultName)
36
            ->setDescription('Creates elasticsearch index.')
37
            ->addOption('time', 't', InputOption::VALUE_NONE, 'Adds date suffix to the new index name')
38
            ->addOption(
39
                'alias',
40
                'a',
41
                InputOption::VALUE_NONE,
42
                'If the time suffix is used, its nice to create an alias to the configured index name.'
43
            )
44
            ->addOption('no-mapping', null, InputOption::VALUE_NONE, 'Do not include mapping')
45
            ->addOption(
46
                'if-not-exists',
47
                null,
48
                InputOption::VALUE_NONE,
49
                'Don\'t trigger an error, when the index already exists'
50
            )
51
            ->addOption('dump', null, InputOption::VALUE_NONE, 'Prints out index mapping json');
52
    }
53
54
    /**
55
     * {@inheritdoc}

Command/IndexExportCommand.php 1 location

@@ 31-60 (lines=30) @@
28
    /**
29
     * {@inheritdoc}
30
     */
31
    protected function configure()
32
    {
33
        parent::configure();
34
35
        $this
36
            ->setName(static::$defaultName)
37
            ->setDescription('Exports data from elasticsearch index.')
38
            ->addArgument(
39
                'filename',
40
                InputArgument::REQUIRED,
41
                'Select file to store output'
42
            )->addOption(
43
                'types',
44
                null,
45
                InputOption::VALUE_REQUIRED + InputOption::VALUE_IS_ARRAY,
46
                'Export specific types only'
47
            )->addOption(
48
                'chunk',
49
                null,
50
                InputOption::VALUE_REQUIRED,
51
                'Chunk size to use in scan api',
52
                500
53
            )->addOption(
54
                'split',
55
                null,
56
                InputOption::VALUE_REQUIRED,
57
                'Split file in a separate parts if line number exceeds provided value',
58
                300000
59
            );
60
    }
61
62
    /**
63
     * {@inheritdoc}