Issue #2418179 by martin107: twig.engine needs some documentation fixes

8.0.x
Alex Pott 2015-02-05 09:24:24 +00:00
parent 685470f2df
commit e5d8a95a1b
1 changed files with 8 additions and 8 deletions

View File

@ -40,15 +40,15 @@ function twig_init(Extension $theme) {
* If the Twig debug setting is enabled, HTML comments including _theme() call * If the Twig debug setting is enabled, HTML comments including _theme() call
* and template file name suggestions will surround the template markup. * and template file name suggestions will surround the template markup.
* *
* @param $template_file * @param string $template_file
* The file name of the template to render. * The file name of the template to render.
* @param $variables * @param array $variables
* A keyed array of variables that will appear in the output. * A keyed array of variables that will appear in the output.
* *
* @return string * @return string
* The output generated by the template, plus any debug information. * The output generated by the template, plus any debug information.
*/ */
function twig_render_template($template_file, $variables) { function twig_render_template($template_file, array $variables) {
/** @var \Twig_Environment $twig_service */ /** @var \Twig_Environment $twig_service */
$twig_service = \Drupal::service('twig'); $twig_service = \Drupal::service('twig');
try { try {
@ -118,9 +118,9 @@ function twig_render_template($template_file, $variables) {
* returned directly. * returned directly.
* *
* @param mixed $arg * @param mixed $arg
* String, Object or Render Array * String, Object or Render Array.
* *
* @return * @return mixed
* The rendered output or an Twig_Markup object. * The rendered output or an Twig_Markup object.
* *
* @see render * @see render
@ -167,7 +167,7 @@ function twig_render_var($arg) {
* elements. The original renderable array is still available and can be used * elements. The original renderable array is still available and can be used
* to print child elements in their entirety in the twig template. * to print child elements in their entirety in the twig template.
* *
* @param array $element * @param array|object $element
* The parent renderable array to exclude the child items. * The parent renderable array to exclude the child items.
* @param string[] $args, ... * @param string[] $args, ...
* The string keys of $element to prevent printing. * The string keys of $element to prevent printing.
@ -197,7 +197,7 @@ function twig_without($element) {
* *
* Replacement function for Twig's escape filter. * Replacement function for Twig's escape filter.
* *
* @param Twig_Environment $env * @param \Twig_Environment $env
* A Twig_Environment instance. * A Twig_Environment instance.
* @param string $string * @param string $string
* The value to be escaped. * The value to be escaped.