simplified some phpdocs

This commit is contained in:
Fabien Potencier
2019-02-15 04:20:04 +01:00
parent 4ea6ff4a55
commit ceb3c93e28
5 changed files with 37 additions and 64 deletions
+1 -2
View File
@@ -65,8 +65,7 @@ class Twig_Compiler implements Twig_CompilerInterface
/**
* Compiles a node.
*
* @param Twig_NodeInterface $node The node to compile
* @param int $indentation The current indentation
* @param int $indentation The current indentation
*
* @return $this
*/
-3
View File
@@ -94,9 +94,6 @@ class Twig_Environment
* * optimizations: A flag that indicates which optimizations to apply
* (default to -1 which means that all optimizations are enabled;
* set it to 0 to disable).
*
* @param Twig_LoaderInterface $loader
* @param array $options An array of options
*/
public function __construct(Twig_LoaderInterface $loader = null, $options = [])
{
+35 -56
View File
@@ -300,7 +300,6 @@ function twig_cycle($values, $position)
* - a random character from a string
* - a random integer between 0 and the integer parameter.
*
* @param Twig_Environment $env
* @param Traversable|array|int|float|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)
@@ -358,7 +357,6 @@ function twig_random(Twig_Environment $env, $values = null)
*
* {{ post.published_at|date("m/d/Y") }}
*
* @param Twig_Environment $env
* @param DateTime|DateTimeInterface|DateInterval|string $date A date
* @param string|null $format The target format, null to use the default
* @param DateTimeZone|string|false|null $timezone The target timezone, null to use the default, false to leave unchanged
@@ -384,9 +382,8 @@ 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
* @param DateTime|string $date A date
* @param string $modifier A modifier string
* @param DateTime|string $date A date
* @param string $modifier A modifier string
*
* @return DateTime A new date object
*/
@@ -408,7 +405,6 @@ function twig_date_modify_filter(Twig_Environment $env, $date, $modifier)
* {# do something #}
* {% endif %}
*
* @param Twig_Environment $env
* @param DateTime|DateTimeInterface|string|null $date A date
* @param DateTimeZone|string|false|null $timezone The target timezone, null to use the default, false to leave unchanged
*
@@ -510,11 +506,10 @@ 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
* @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 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
*/
@@ -616,11 +611,10 @@ function twig_array_merge($arr1, $arr2)
/**
* Slices a variable.
*
* @param Twig_Environment $env
* @param mixed $item A variable
* @param int $start Start of the slice
* @param int $length Size of the slice
* @param bool $preserveKeys Whether to preserve key or not (when the input is an array)
* @param mixed $item A variable
* @param int $start Start of the slice
* @param int $length Size of the slice
* @param bool $preserveKeys Whether to preserve key or not (when the input is an array)
*
* @return mixed The sliced variable
*/
@@ -658,8 +652,7 @@ function twig_slice(Twig_Environment $env, $item, $start, $length = null, $prese
/**
* Returns the first element of the item.
*
* @param Twig_Environment $env
* @param mixed $item A variable
* @param mixed $item A variable
*
* @return mixed The first element of the item
*/
@@ -673,8 +666,7 @@ function twig_first(Twig_Environment $env, $item)
/**
* Returns the last element of the item.
*
* @param Twig_Environment $env
* @param mixed $item A variable
* @param mixed $item A variable
*
* @return mixed The last element of the item
*/
@@ -744,10 +736,9 @@ function twig_join_filter($value, $glue = '', $and = null)
* {{ "aabbcc"|split('', 2) }}
* {# returns [aa, bb, cc] #}
*
* @param Twig_Environment $env
* @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
*/
@@ -842,7 +833,6 @@ function twig_get_array_keys_filter($array)
/**
* Reverses a variable.
*
* @param Twig_Environment $env
* @param array|Traversable|string $item An array, a Traversable instance, or a string
* @param bool $preserveKeys Whether to preserve key or not
*
@@ -957,11 +947,10 @@ function twig_trim_filter($string, $characterMask = null, $side = 'both')
/**
* Escapes a string.
*
* @param Twig_Environment $env
* @param mixed $string The value to be escaped
* @param string $strategy The escaping strategy
* @param string $charset The charset
* @param bool $autoescape Whether the function is called by the auto-escaping feature (true) or by the developer (false)
* @param mixed $string The value to be escaped
* @param string $strategy The escaping strategy
* @param string $charset The charset
* @param bool $autoescape Whether the function is called by the auto-escaping feature (true) or by the developer (false)
*
* @return string
*/
@@ -1253,8 +1242,7 @@ if (function_exists('mb_get_info')) {
/**
* Returns the length of a variable.
*
* @param Twig_Environment $env
* @param mixed $thing A variable
* @param mixed $thing A variable
*
* @return int The length of the value
*/
@@ -1290,8 +1278,7 @@ if (function_exists('mb_get_info')) {
/**
* Converts a string to uppercase.
*
* @param Twig_Environment $env
* @param string $string A string
* @param string $string A string
*
* @return string The uppercased string
*/
@@ -1307,8 +1294,7 @@ if (function_exists('mb_get_info')) {
/**
* Converts a string to lowercase.
*
* @param Twig_Environment $env
* @param string $string A string
* @param string $string A string
*
* @return string The lowercased string
*/
@@ -1324,8 +1310,7 @@ if (function_exists('mb_get_info')) {
/**
* Returns a titlecased string.
*
* @param Twig_Environment $env
* @param string $string A string
* @param string $string A string
*
* @return string The titlecased string
*/
@@ -1341,8 +1326,7 @@ if (function_exists('mb_get_info')) {
/**
* Returns a capitalized string.
*
* @param Twig_Environment $env
* @param string $string A string
* @param string $string A string
*
* @return string The capitalized string
*/
@@ -1360,8 +1344,7 @@ else {
/**
* Returns the length of a variable.
*
* @param Twig_Environment $env
* @param mixed $thing A variable
* @param mixed $thing A variable
*
* @return int The length of the value
*/
@@ -1397,8 +1380,7 @@ else {
/**
* Returns a titlecased string.
*
* @param Twig_Environment $env
* @param string $string A string
* @param string $string A string
*
* @return string The titlecased string
*/
@@ -1410,8 +1392,7 @@ else {
/**
* Returns a capitalized string.
*
* @param Twig_Environment $env
* @param string $string A string
* @param string $string A string
*
* @return string The capitalized string
*/
@@ -1478,13 +1459,12 @@ function twig_test_iterable($value)
/**
* Renders a template.
*
* @param Twig_Environment $env
* @param array $context
* @param string|array $template The template to render or an array of templates to try consecutively
* @param array $variables The variables to pass to the template
* @param bool $withContext
* @param bool $ignoreMissing Whether to ignore missing templates or not
* @param bool $sandboxed Whether to sandbox the template or not
* @param array $context
* @param string|array $template The template to render or an array of templates to try consecutively
* @param array $variables The variables to pass to the template
* @param bool $withContext
* @param bool $ignoreMissing Whether to ignore missing templates or not
* @param bool $sandboxed Whether to sandbox the template or not
*
* @return string The rendered template
*/
@@ -1538,9 +1518,8 @@ function twig_include(Twig_Environment $env, $context, $template, $variables = [
/**
* Returns a template content without rendering it.
*
* @param Twig_Environment $env
* @param string $name The template name
* @param bool $ignoreMissing Whether to ignore missing templates or not
* @param string $name The template name
* @param bool $ignoreMissing Whether to ignore missing templates or not
*
* @return string The template source
*/
+1 -2
View File
@@ -32,8 +32,7 @@ class Twig_Extension_StringLoader extends Twig_Extension
*
* {{ include(template_from_string("Hello {{ name }}")) }}
*
* @param Twig_Environment $env A Twig_Environment instance
* @param string $template A template as a string or object implementing __toString()
* @param string $template A template as a string or object implementing __toString()
*
* @return Twig_Template
*/
-1
View File
@@ -24,7 +24,6 @@ class Twig_NodeTraverser
protected $visitors = [];
/**
* @param Twig_Environment $env
* @param Twig_NodeVisitorInterface[] $visitors
*/
public function __construct(Twig_Environment $env, array $visitors = [])