Removed unnecessary twig_constant_filter function
authorJordi Boggiano <j.boggiano@seld.be>
Thu, 21 Oct 2010 18:17:56 +0000 (20:17 +0200)
committerFabien Potencier <fabien.potencier@gmail.com>
Fri, 22 Oct 2010 06:35:44 +0000 (08:35 +0200)
lib/Twig/Extension/Core.php

index 66342e5..c00c328 100644 (file)
@@ -55,7 +55,7 @@ class Twig_Extension_Core extends Twig_Extension
             'upper'      => new Twig_Filter_Function('strtoupper'),
             'lower'      => new Twig_Filter_Function('strtolower'),
             'striptags'  => new Twig_Filter_Function('strip_tags'),
-            'constant'   => new Twig_Filter_Function('twig_constant_filter'),
+            'constant'   => new Twig_Filter_Function('constant'),
 
             // array helpers
             'join'    => new Twig_Filter_Function('twig_join_filter'),
@@ -201,11 +201,6 @@ function twig_cycle_filter($values, $i)
     return $values[$i % count($values)];
 }
 
-function twig_constant_filter($constant)
-{
-    return constant($constant);
-}
-
 function twig_strtr($pattern, $replacements)
 {
     return str_replace(array_keys($replacements), array_values($replacements), $pattern);