3 namespace Drupal\webprofiler\Helper;
5 use Drupal\Core\Config\ConfigFactoryInterface;
6 use Drupal\Component\Render\FormattableMarkup;
9 * Class IdeLinkGenerator.
11 class IdeLinkGenerator implements IdeLinkGeneratorInterface {
14 * @var \Drupal\Core\Config\ConfigFactoryInterface
16 private $config_factory;
19 * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
21 public function __construct(ConfigFactoryInterface $config_factory) {
22 $this->config_factory = $config_factory;
28 public function generateLink($file, $line) {
29 $ide_link = $this->config_factory->get('webprofiler.config')
31 $ide_link_remote = $this->config_factory->get('webprofiler.config')
32 ->get('ide_link_remote');
33 $ide_link_local = $this->config_factory->get('webprofiler.config')
34 ->get('ide_link_local');
36 $file = str_replace($ide_link_remote, $ide_link_local, $file);
38 return new FormattableMarkup($ide_link, ['@file' => $file, '@line' => $line]);