urlBuilder = $urlBuilder; } /** * {@inheritdoc} */ public function getFilters() { return [ new TwigFilter('murph_url', [$this, 'replaceUrl']), ]; } public function replaceUrl(?string $content) { return $this->urlBuilder->replaceTags((string) $content); } }