Completed
Push — develop ( e4a933...b1fd58 )
by Tom
03:38
created

ReindexAllCommand   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 9 1
A execute() 0 14 2
1
<?php
2
3
namespace N98\Magento\Command\Indexer;
4
5
use Mage_Index_Model_Process;
6
use Mage_Index_Model_Resource_Process_Collection;
7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Output\OutputInterface;
9
10
class ReindexAllCommand extends AbstractIndexerCommand
11
{
12
    protected function configure()
13
    {
14
        $this
15
            ->setName('index:reindex:all')
16
            ->setDescription('Reindex all magento indexes')
17
        ;
18
19
        $this->setHelp('Loops all magento indexes and triggers reindex.');
20
    }
21
22
    /**
23
     * @param InputInterface  $input
24
     * @param OutputInterface $output
25
     *
26
     * @return int|void
27
     */
28
    protected function execute(InputInterface $input, OutputInterface $output)
29
    {
30
        $this->detectMagento($output, true);
31
        if (!$this->initMagento()) {
32
            return;
33
        }
34
35
        $this->disableObservers();
36
37
        /* @var $processes Mage_Index_Model_Resource_Process_Collection|Mage_Index_Model_Process[] */
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
38
        $processes = $this->getIndexerModel()->getProcessesCollection();
39
40
        $this->executeProcesses($output, iterator_to_array($processes, false));
41
    }
42
}
43