mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-16 12:26:30 +00:00
fixed CS
This commit is contained in:
@@ -13,6 +13,8 @@
|
|||||||
* Autoloads Twig classes.
|
* Autoloads Twig classes.
|
||||||
*
|
*
|
||||||
* @author Fabien Potencier <fabien@symfony.com>
|
* @author Fabien Potencier <fabien@symfony.com>
|
||||||
|
*
|
||||||
|
* @deprecated Use Composer instead. Will be removed in Twig 2.0.
|
||||||
*/
|
*/
|
||||||
class Twig_Autoloader
|
class Twig_Autoloader
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -43,8 +43,8 @@ abstract class Twig_BaseNodeVisitor implements Twig_NodeVisitorInterface
|
|||||||
/**
|
/**
|
||||||
* Called before child nodes are visited.
|
* Called before child nodes are visited.
|
||||||
*
|
*
|
||||||
* @param Twig_Node $node The node to visit
|
* @param Twig_Node $node The node to visit
|
||||||
* @param Twig_Environment $env The Twig environment instance
|
* @param Twig_Environment $env The Twig environment instance
|
||||||
*
|
*
|
||||||
* @return Twig_Node The modified node
|
* @return Twig_Node The modified node
|
||||||
*/
|
*/
|
||||||
|
|||||||
+22
-22
@@ -384,8 +384,8 @@ function twig_cycle($values, $position)
|
|||||||
* - a random character from a string
|
* - a random character from a string
|
||||||
* - a random integer between 0 and the integer parameter.
|
* - a random integer between 0 and the integer parameter.
|
||||||
*
|
*
|
||||||
* @param Twig_Environment $env A Twig_Environment instance
|
* @param Twig_Environment $env A Twig_Environment instance
|
||||||
* @param Traversable|array|int|string $values The values to pick a random item from
|
* @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).
|
* @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") }}
|
* {{ post.published_at|date_modify("-1day")|date("m/d/Y") }}
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @param Twig_Environment $env A Twig_Environment instance
|
* @param Twig_Environment $env A Twig_Environment instance
|
||||||
* @param DateTime|string $date A date
|
* @param DateTime|string $date A date
|
||||||
* @param string $modifier A modifier string
|
* @param string $modifier A modifier string
|
||||||
*
|
*
|
||||||
* @return DateTime A new date object
|
* @return DateTime A new date object
|
||||||
*/
|
*/
|
||||||
@@ -545,11 +545,11 @@ function twig_date_converter(Twig_Environment $env, $date = null, $timezone = nu
|
|||||||
/**
|
/**
|
||||||
* Rounds a number.
|
* Rounds a number.
|
||||||
*
|
*
|
||||||
* @param int|float $value The value to round
|
* @param int|float $value The value to round
|
||||||
* @param int|float $precision The rounding precision
|
* @param int|float $precision The rounding precision
|
||||||
* @param string $method The method to use for rounding
|
* @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')
|
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
|
* be used. Supplying any of the parameters will override the defaults set in the
|
||||||
* environment object.
|
* environment object.
|
||||||
*
|
*
|
||||||
* @param Twig_Environment $env A Twig_Environment instance
|
* @param Twig_Environment $env A Twig_Environment instance
|
||||||
* @param mixed $number A float/int/string of the number to format
|
* @param mixed $number A float/int/string of the number to format
|
||||||
* @param int $decimal The number of decimal points to display.
|
* @param int $decimal The number of decimal points to display.
|
||||||
* @param string $decimalPoint The character(s) to use for the decimal point.
|
* @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 string $thousandSep The character(s) to use for the thousands separator.
|
||||||
*
|
*
|
||||||
* @return string The formatted number
|
* @return string The formatted number
|
||||||
*/
|
*/
|
||||||
@@ -805,9 +805,9 @@ function twig_join_filter($value, $glue = '')
|
|||||||
* {# returns [aa, bb, cc] #}
|
* {# returns [aa, bb, cc] #}
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @param string $value A string
|
* @param string $value A string
|
||||||
* @param string $delimiter The delimiter
|
* @param string $delimiter The delimiter
|
||||||
* @param int $limit The limit
|
* @param int $limit The limit
|
||||||
*
|
*
|
||||||
* @return array The split string as an array
|
* @return array The split string as an array
|
||||||
*/
|
*/
|
||||||
@@ -1369,7 +1369,7 @@ function twig_ensure_traversable($seq)
|
|||||||
*
|
*
|
||||||
* @param mixed $value A variable
|
* @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)
|
function twig_test_empty($value)
|
||||||
{
|
{
|
||||||
@@ -1392,7 +1392,7 @@ function twig_test_empty($value)
|
|||||||
*
|
*
|
||||||
* @param mixed $value A variable
|
* @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)
|
function twig_test_iterable($value)
|
||||||
{
|
{
|
||||||
@@ -1486,9 +1486,9 @@ function twig_constant($constant, $object = null)
|
|||||||
/**
|
/**
|
||||||
* Batches item.
|
* Batches item.
|
||||||
*
|
*
|
||||||
* @param array $items An array of items
|
* @param array $items An array of items
|
||||||
* @param int $size The size of the batch
|
* @param int $size The size of the batch
|
||||||
* @param mixed $fill A value used to fill missing items
|
* @param mixed $fill A value used to fill missing items
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ abstract class Twig_Template implements Twig_TemplateInterface
|
|||||||
|
|
||||||
if (null !== $template) {
|
if (null !== $template) {
|
||||||
// avoid RCEs when sandbox is enabled
|
// 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.');
|
throw new \LogicException('A block must be a method on a Twig_Template instance.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user