Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add frontend template hints status command #26451

Merged
merged 17 commits into from
Feb 9, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class TemplateHintsStatusCommand extends Command
/**
* @var ScopeConfigInterface
*/
protected $scopeConfig;
private $scopeConfig;

/**
* Initialize dependencies.
Expand Down Expand Up @@ -53,12 +53,23 @@ protected function configure()
protected function execute(InputInterface $input, OutputInterface $output)
{
$templateHintsStatus =
($this->scopeConfig->isSetFlag('dev/debug/template_hints_storefront', 'default'))
($this->isTemplateHintsEnabled())
? 'enabled'
: 'disabled';
$templateHintsMessage = __("Template hints are %status", ['status' => $templateHintsStatus]);
$output->writeln("<info>" . $templateHintsMessage . "</info>");
WaPoNe marked this conversation as resolved.
Show resolved Hide resolved

return 0;
return \Magento\Framework\Console\Cli::RETURN_SUCCESS;
WaPoNe marked this conversation as resolved.
Show resolved Hide resolved
}

/**
* @return bool
*/
private function isTemplateHintsEnabled()
WaPoNe marked this conversation as resolved.
Show resolved Hide resolved
{
$result = ($this->scopeConfig->isSetFlag('dev/debug/template_hints_storefront', 'default'))
WaPoNe marked this conversation as resolved.
Show resolved Hide resolved
? true
: false;
return $result;
}
WaPoNe marked this conversation as resolved.
Show resolved Hide resolved
}