Completed
Pull Request — develop (#817)
by Robbie
04:29
created

TemplateHintsCommand   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 45
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
c 2
b 0
f 0
lcom 0
cbo 1
dl 45
loc 45
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A _afterSave() 4 4 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
namespace N98\Magento\Command\Developer;
4
5
use N98\Magento\Command\AbstractMagentoStoreConfigCommand;
6
7 View Code Duplication
class TemplateHintsCommand extends AbstractMagentoStoreConfigCommand
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...
8
{
9
    /**
10
     * @var string
11
     */
12
    protected $commandName = 'dev:template-hints';
13
14
    /**
15
     * @var string
16
     */
17
    protected $commandDescription = 'Toggles template hints';
18
19
    /**
20
     * @var string
21
     */
22
    protected $toggleComment = 'Template Hints';
23
24
    /**
25
     * @var string
26
     */
27
    protected $configPath = 'dev/debug/template_hints';
28
29
    /**
30
     * @var string
31
     */
32
    protected $scope = self::SCOPE_STORE_VIEW;
33
34
    /**
35
     * Add admin store to interactive prompt
36
     *
37
     * @var bool
38
     */
39
    protected $withAdminStore = true;
40
41
    /**
42
     * If required, handle the output and possible change of the developer IP restrictions
43
     *
44
     * @param \Mage_Core_Model_Store $store
45
     * @param bool $disabled
46
     */
47
    protected function _afterSave(\Mage_Core_Model_Store $store, $disabled)
48
    {
49
        $this->detectAskAndSetDeveloperIp($store, $disabled);
50
    }
51
}
52