From: Fabien Potencier Date: Fri, 6 Jan 2012 19:35:29 +0000 (+0100) Subject: added missing phpdoc X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=260505129e4b176966fa17915c09e58186470516;p=web%2Fkonrad%2Ftwig.git added missing phpdoc --- diff --git a/lib/Twig/Extension/Core.php b/lib/Twig/Extension/Core.php index 1e18be3..f78be90 100644 --- a/lib/Twig/Extension/Core.php +++ b/lib/Twig/Extension/Core.php @@ -329,6 +329,20 @@ function twig_date_format_filter(Twig_Environment $env, $date, $format = null, $ return twig_date_converter($date, $timezone)->format($format); } +/** + * Converts an input to a DateTime instance. + * + *
+ *    {% if date(user.created_at) < date('+2days') %}
+ *      {# do something #}
+ *    {% endif %}
+ * 
+ * + * @param DateTime|string $date A date + * @param DateTimeZone|string $timezone A timezone + * + * @return DateTime A DateTime instance + */ function twig_date_converter($date = null, $timezone = null) { if ($date instanceof DateTime) {