translator = $translator; $this->inlineProvider = $inlineProvider; $this->logger = $logger; } /** * Render source text * * @param [] $source * @param [] $arguments * @return string * @throws \Exception * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function render(array $source, array $arguments) { $text = end($source); try { if (!$this->inlineProvider->get()->isAllowed()) { return $text; } if (strpos($text, '{{{') === false || strpos($text, '}}}') === false || strpos($text, '}}{{') === false ) { $text = '{{{' . implode('}}{{', array_reverse($source)) . '}}{{' . $this->translator->getTheme() . '}}}'; } } catch (\Exception $e) { $this->logger->critical($e->getMessage()); throw $e; } return $text; } }