/** * Render source text * * @param [] $source * @param [] $arguments * @return string */ public function render(array $source, array $arguments) { $text = end($source); 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() . '}}}'; } return $text; }
/** * 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; }