SchemaPostUpdate::execute()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 21
Code Lines 14

Duplication

Lines 21
Ratio 100 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 21
loc 21
rs 9.3142
cc 3
eloc 14
nc 3
nop 0
1
<?php
2
3
namespace N98\Magento\Command\System\Setup\SubCommand;
4
5
use N98\Magento\Command\SubCommand\AbstractSubCommand;
6
use Symfony\Component\Console\Output\OutputInterface;
7
8 View Code Duplication
class SchemaPostUpdate extends AbstractSubCommand
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
9
{
10
    /**
11
     * @return bool
12
     */
13
    public function execute()
14
    {
15
        $moduleNames = $this->config->getArray('moduleNames');
16
        $setupFactory = $this->config->getObject('setupFactory');
17
        $logger = $this->config->getObject('logger');
18
        $progress = $this->getCommand()->getHelper('progress');
19
20
        $progress->start($this->output, count($moduleNames));
21
        foreach ($moduleNames as $moduleName) {
22
            if (OutputInterface::VERBOSITY_VERBOSE <= $this->output->getVerbosity()) {
23
                $this->output->writeln("\n" . '<debug>' . $moduleName . '</debug>');
24
            }
25
26
            $setup = $setupFactory->createSetupModule($logger, $moduleName);
27
            $setup->applyRecurringUpdates();
28
            $progress->advance();
29
        }
30
        $progress->finish();
31
32
        return true;
33
    }
34
}
35