From 1687097ed0bcf89fb5ce30b068054275fe481b91 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Wed, 19 Aug 2015 15:19:42 +0200 Subject: [PATCH] Fix the deprecation warning for functions and tests --- lib/Twig/Environment.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Twig/Environment.php b/lib/Twig/Environment.php index c98741084..f68e373d1 100644 --- a/lib/Twig/Environment.php +++ b/lib/Twig/Environment.php @@ -1230,7 +1230,7 @@ class Twig_Environment if ($function instanceof Twig_SimpleFunction) { $name = $function->getName(); } else { - @trigger_error(sprintf('Using an instance of "%s" for function "%s" is deprecated. Use Twig_SimpleFunction instead.', get_class($filter), $name), E_USER_DEPRECATED); + @trigger_error(sprintf('Using an instance of "%s" for function "%s" is deprecated. Use Twig_SimpleFunction instead.', get_class($function), $name), E_USER_DEPRECATED); } $this->functions[$name] = $function; @@ -1241,7 +1241,7 @@ class Twig_Environment if ($test instanceof Twig_SimpleTest) { $name = $test->getName(); } else { - @trigger_error(sprintf('Using an instance of "%s" for test "%s" is deprecated. Use Twig_SimpleTest instead.', get_class($filter), $name), E_USER_DEPRECATED); + @trigger_error(sprintf('Using an instance of "%s" for test "%s" is deprecated. Use Twig_SimpleTest instead.', get_class($test), $name), E_USER_DEPRECATED); } $this->tests[$name] = $test;