config = $config; $this->version = $version; $this->state = $state; } /** * Perform response postprocessing * * @param FrontControllerInterface $subject * @param ResponseInterface|ResultInterface $result * @return ResponseHttp|ResultInterface * * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function afterDispatch(FrontControllerInterface $subject, $result) { if ($this->config->getType() == Config::VARNISH && $this->config->isEnabled() && $result instanceof ResponseHttp ) { $this->version->process(); if ($this->state->getMode() == AppState::MODE_DEVELOPER) { $result->setHeader('X-Magento-Debug', 1); } } return $result; } }