Skip to content

Commit 0d1ccc6

Browse files
author
Oleksii Korshenko
committed
MAGETWO-69544: new CLI command: Enable Template Hints #9778
- fixed code style
1 parent dbff27d commit 0d1ccc6

File tree

2 files changed

+25
-14
lines changed

2 files changed

+25
-14
lines changed

app/code/Magento/Developer/Console/Command/TemplateHintsDisableCommand.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Symfony\Component\Console\Command\Command;
1010
use Symfony\Component\Console\Input\InputInterface;
1111
use Symfony\Component\Console\Output\OutputInterface;
12+
use Magento\Framework\App\Config\ConfigResource\ConfigInterface;
1213

1314
class TemplateHintsDisableCommand extends Command
1415
{
@@ -23,14 +24,19 @@ class TemplateHintsDisableCommand extends Command
2324
const SUCCESS_MESSAGE = "Template hints disabled. Refresh cache types";
2425

2526
/**
26-
* TemplateHintsDisableCommand constructor.
27-
* @param \Magento\Config\Model\ResourceModel\Config $resourceConfig
27+
* @var ConfigInterface
2828
*/
29-
public function __construct(
30-
\Magento\Config\Model\ResourceModel\Config $resourceConfig
29+
private $resourceConfig;
30+
31+
/**
32+
* Initialize dependencies.
33+
*
34+
* @param ConfigInterface $resourceConfig
35+
*/
36+
public function __construct(ConfigInterface $resourceConfig
3137
) {
3238
parent::__construct();
33-
$this->_resourceConfig = $resourceConfig;
39+
$this->resourceConfig = $resourceConfig;
3440
}
3541

3642
/**
@@ -50,7 +56,7 @@ protected function configure()
5056
*/
5157
protected function execute(InputInterface $input, OutputInterface $output)
5258
{
53-
$this->_resourceConfig->saveConfig(
59+
$this->resourceConfig->saveConfig(
5460
'dev/debug/template_hints_storefront',
5561
0,
5662
'default',

app/code/Magento/Developer/Console/Command/TemplateHintsEnableCommand.php

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Symfony\Component\Console\Command\Command;
1010
use Symfony\Component\Console\Input\InputInterface;
1111
use Symfony\Component\Console\Output\OutputInterface;
12-
12+
use Magento\Framework\App\Config\ConfigResource\ConfigInterface;
1313

1414
class TemplateHintsEnableCommand extends Command
1515
{
@@ -25,14 +25,19 @@ class TemplateHintsEnableCommand extends Command
2525
const SUCCESS_MESSAGE = "Template hints enabled.";
2626

2727
/**
28-
* TemplateHintsDisableCommand constructor.
29-
* @param \Magento\Config\Model\ResourceModel\Config $resourceConfig
28+
* @var ConfigInterface
29+
*/
30+
private $resourceConfig;
31+
32+
/**
33+
* Initialize dependencies.
34+
*
35+
* @param ConfigInterface $resourceConfig
3036
*/
31-
public function __construct(
32-
\Magento\Config\Model\ResourceModel\Config $resourceConfig
37+
public function __construct(ConfigInterface $resourceConfig
3338
) {
3439
parent::__construct();
35-
$this->_resourceConfig = $resourceConfig;
40+
$this->resourceConfig = $resourceConfig;
3641
}
3742

3843
/**
@@ -41,7 +46,7 @@ public function __construct(
4146
protected function configure()
4247
{
4348
$this->setName(self::COMMAND_NAME)
44-
->setDescription('Disable frontend template hints. A cache flush might be required.');
49+
->setDescription('Enable frontend template hints. A cache flush might be required.');
4550

4651
parent::configure();
4752
}
@@ -52,7 +57,7 @@ protected function configure()
5257
*/
5358
protected function execute(InputInterface $input, OutputInterface $output)
5459
{
55-
$this->_resourceConfig->saveConfig(
60+
$this->resourceConfig->saveConfig(
5661
'dev/debug/template_hints_storefront',
5762
1,
5863
'default',

0 commit comments

Comments
 (0)