This issue is a side issue from https://www.drupal.org/node/2417733

It contains some unrelated documentation flaws.

Most are very minor but I need to headline one. Which makes this a bug report rather than a task.

The documentation of twig_without() makes reference to a deleted parameter.

I have also inserted an array prefix into a few function parameter definitions. So this patch cannot be regarded as a documentation only patch.
Some test might fall over, but that is a good thing to know!

Comments

Status: Needs review » Needs work

The last submitted patch, twig.engine.patch, failed testing.

joelpittet’s picture

Thanks for the clean-up.

+++ b/core/themes/engines/twig/twig.engine
@@ -169,13 +169,11 @@ function twig_render_var($arg) {
-function twig_without($element) {
+function twig_without(array $element) {

This one isn't always an array, sometimes it's an object with ArrayAccess.

All the rest should work.

martin107’s picture

Status: Needs work » Needs review
StatusFileSize
new2.25 KB
new760 bytes

Ah rats - Backing out the change and updating the documentation.

Other parameter definitions specify array|object -but not many see _drupal_rewrite_settings_global()

joelpittet’s picture

Status: Needs review » Needs work

Thanks one more thing, I think.

+++ b/core/themes/engines/twig/twig.engine
@@ -167,10 +167,8 @@ function twig_render_var($arg) {
- * @param string[] $args, ...
- *   The string keys of $element to prevent printing.

This needs to stay, it's correct and I wrote it:P

martin107’s picture

Status: Needs work » Needs review

@joelpittet - Can I politely disagree...

The $args @param definition I want to removed relates to twig_without($element) not twig_render_var($arg)

$args is now internal to the function it set from a call to func_get_args()

joelpittet’s picture

@martin107 yes, twig_without() function, you were there too:)

The main purpose of that function is those $args, because those are what the $element are doing 'without'. That's why they are documented.

https://www.drupal.org/node/2114563#comment-8554679
https://www.drupal.org/node/2114563#comment-8200265

martin107’s picture

StatusFileSize
new2.19 KB
new502 bytes

You are right, I am complete wrong.

'cuse me while I wipe all that egg of my face :)

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community

No worries, it's not documented in the coding standards, which would be nice.

This looks like a nice doc clean-up.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Documentation is not frozen in the beta. Committed e5d8a95 and pushed to 8.0.x. Thanks!

  • alexpott committed e5d8a95 on 8.0.x
    Issue #2418179 by martin107: twig.engine needs some documentation fixes
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.