diff --git a/Twig/RollbarExtension.php b/Twig/RollbarExtension.php index 1814ab6..acba065 100644 --- a/Twig/RollbarExtension.php +++ b/Twig/RollbarExtension.php @@ -56,9 +56,9 @@ public function __construct( public function getFunctions() { return array( - 'rollbarjs' => new \Twig_Function_Method( - $this, - 'getInitRollbarCode', + new \Twig_SimpleFunction( + 'rollbarjs', + array($this, 'getInitRollbarCode'), array( 'needs_context' => true, 'is_safe' => array('html'),