scopeConfig = $scopeConfig; $this->storeManager = $storeManager; $this->devHelper = $devHelper; $this->debugHintsFactory = $debugHintsFactory; $this->debugHintsPath = $debugHintsPath; } /** * Wrap template engine instance with the debugging hints decorator, depending of the store configuration * * @param TemplateEngineFactory $subject * @param TemplateEngineInterface $invocationResult * * @return TemplateEngineInterface * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function afterCreate( TemplateEngineFactory $subject, TemplateEngineInterface $invocationResult ) { $storeCode = $this->storeManager->getStore()->getCode(); if ($this->scopeConfig->getValue($this->debugHintsPath, ScopeInterface::SCOPE_STORE, $storeCode) && $this->devHelper->isDevAllowed()) { $showBlockHints = $this->scopeConfig->getValue( self::XML_PATH_DEBUG_TEMPLATE_HINTS_BLOCKS, ScopeInterface::SCOPE_STORE, $storeCode ); return $this->debugHintsFactory->create([ 'subject' => $invocationResult, 'showBlockHints' => $showBlockHints, ]); } return $invocationResult; } }