diff --git a/CHANGELOG.md b/CHANGELOG.md index e41d522d..ab0c03cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +- Fix compatibility issue with Twig >= 3.4.0 (#628) + ## 4.2.9 (2022-05-03) - Fix deprecation notice thrown when instrumenting the `PDOStatement::bindParam()` method and passing `$length = null` on DBAL `2.x` (#613) diff --git a/src/Twig/SentryExtension.php b/src/Twig/SentryExtension.php index c86a393f..8a405c44 100644 --- a/src/Twig/SentryExtension.php +++ b/src/Twig/SentryExtension.php @@ -29,14 +29,14 @@ public function __construct(HubInterface $hub) public function getFunctions(): array { return [ - new TwigFunction('sentry_trace_meta', \Closure::fromCallable([$this, 'getTraceMeta']), ['is_safe' => ['html']]), + new TwigFunction('sentry_trace_meta', [$this, 'getTraceMeta'], ['is_safe' => ['html']]), ]; } /** * Returns an HTML meta tag named `sentry-trace`. */ - private function getTraceMeta(): string + public function getTraceMeta(): string { $span = $this->hub->getSpan();