From 65e70a2c871b78d1d379c51ed54e3b09f0b044cf Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sun, 16 Aug 2015 19:46:53 +0200 Subject: [PATCH] fixed CS --- lib/Twig/Autoloader.php | 2 ++ lib/Twig/BaseNodeVisitor.php | 4 ++-- lib/Twig/Extension/Core.php | 44 ++++++++++++++++++------------------ lib/Twig/Template.php | 2 +- 4 files changed, 27 insertions(+), 25 deletions(-) diff --git a/lib/Twig/Autoloader.php b/lib/Twig/Autoloader.php index 87f741538..2bd3fcc13 100644 --- a/lib/Twig/Autoloader.php +++ b/lib/Twig/Autoloader.php @@ -13,6 +13,8 @@ * Autoloads Twig classes. * * @author Fabien Potencier + * + * @deprecated Use Composer instead. Will be removed in Twig 2.0. */ class Twig_Autoloader { diff --git a/lib/Twig/BaseNodeVisitor.php b/lib/Twig/BaseNodeVisitor.php index bb865d6f9..3c6ef6626 100644 --- a/lib/Twig/BaseNodeVisitor.php +++ b/lib/Twig/BaseNodeVisitor.php @@ -43,8 +43,8 @@ abstract class Twig_BaseNodeVisitor implements Twig_NodeVisitorInterface /** * Called before child nodes are visited. * - * @param Twig_Node $node The node to visit - * @param Twig_Environment $env The Twig environment instance + * @param Twig_Node $node The node to visit + * @param Twig_Environment $env The Twig environment instance * * @return Twig_Node The modified node */ diff --git a/lib/Twig/Extension/Core.php b/lib/Twig/Extension/Core.php index dd69a05da..f1a93c12e 100644 --- a/lib/Twig/Extension/Core.php +++ b/lib/Twig/Extension/Core.php @@ -384,8 +384,8 @@ function twig_cycle($values, $position) * - a random character from a string * - a random integer between 0 and the integer parameter. * - * @param Twig_Environment $env A Twig_Environment instance - * @param Traversable|array|int|string $values The values to pick a random item from + * @param Twig_Environment $env A Twig_Environment instance + * @param Traversable|array|int|string $values The values to pick a random item from * * @throws Twig_Error_Runtime When $values is an empty array (does not apply to an empty string which is returned as is). * @@ -472,9 +472,9 @@ function twig_date_format_filter(Twig_Environment $env, $date, $format = null, $ * {{ post.published_at|date_modify("-1day")|date("m/d/Y") }} * * - * @param Twig_Environment $env A Twig_Environment instance - * @param DateTime|string $date A date - * @param string $modifier A modifier string + * @param Twig_Environment $env A Twig_Environment instance + * @param DateTime|string $date A date + * @param string $modifier A modifier string * * @return DateTime A new date object */ @@ -545,11 +545,11 @@ function twig_date_converter(Twig_Environment $env, $date = null, $timezone = nu /** * Rounds a number. * - * @param int|float $value The value to round - * @param int|float $precision The rounding precision - * @param string $method The method to use for rounding + * @param int|float $value The value to round + * @param int|float $precision The rounding precision + * @param string $method The method to use for rounding * - * @return int|float The rounded number + * @return int|float The rounded number */ function twig_round($value, $precision = 0, $method = 'common') { @@ -571,11 +571,11 @@ function twig_round($value, $precision = 0, $method = 'common') * be used. Supplying any of the parameters will override the defaults set in the * environment object. * - * @param Twig_Environment $env A Twig_Environment instance - * @param mixed $number A float/int/string of the number to format - * @param int $decimal The number of decimal points to display. - * @param string $decimalPoint The character(s) to use for the decimal point. - * @param string $thousandSep The character(s) to use for the thousands separator. + * @param Twig_Environment $env A Twig_Environment instance + * @param mixed $number A float/int/string of the number to format + * @param int $decimal The number of decimal points to display. + * @param string $decimalPoint The character(s) to use for the decimal point. + * @param string $thousandSep The character(s) to use for the thousands separator. * * @return string The formatted number */ @@ -805,9 +805,9 @@ function twig_join_filter($value, $glue = '') * {# returns [aa, bb, cc] #} * * - * @param string $value A string - * @param string $delimiter The delimiter - * @param int $limit The limit + * @param string $value A string + * @param string $delimiter The delimiter + * @param int $limit The limit * * @return array The split string as an array */ @@ -1369,7 +1369,7 @@ function twig_ensure_traversable($seq) * * @param mixed $value A variable * - * @return bool true if the value is empty, false otherwise + * @return bool true if the value is empty, false otherwise */ function twig_test_empty($value) { @@ -1392,7 +1392,7 @@ function twig_test_empty($value) * * @param mixed $value A variable * - * @return bool true if the value is traversable + * @return bool true if the value is traversable */ function twig_test_iterable($value) { @@ -1486,9 +1486,9 @@ function twig_constant($constant, $object = null) /** * Batches item. * - * @param array $items An array of items - * @param int $size The size of the batch - * @param mixed $fill A value used to fill missing items + * @param array $items An array of items + * @param int $size The size of the batch + * @param mixed $fill A value used to fill missing items * * @return array */ diff --git a/lib/Twig/Template.php b/lib/Twig/Template.php index 73150bb59..c3a3bd770 100644 --- a/lib/Twig/Template.php +++ b/lib/Twig/Template.php @@ -155,7 +155,7 @@ abstract class Twig_Template implements Twig_TemplateInterface if (null !== $template) { // avoid RCEs when sandbox is enabled - if (!$template instanceof Twig_Template) { + if (!$template instanceof self) { throw new \LogicException('A block must be a method on a Twig_Template instance.'); }