twigphp / Twig

Twig, the flexible, fast, and secure template language for PHP
https://twig.symfony.com/
BSD 3-Clause "New" or "Revised" License
8.18k stars 1.25k forks source link

Unify error messages when a filter expects a mapping/sequence #4252

Closed fabpot closed 1 month ago

fabpot commented 2 months ago

Besides unifying the error messages, I've also removed the mention of \Traversable as this does not help and is an implementation detail (mapping and sequence are Twig terms, Traversable is not).

Or maybe we should introduce the notion of a "iterable"?

fabpot commented 2 months ago

I would suggest using the concept of "iterable" in those error messages

I've just started to add some docs about Twig types. @drjayvee @ruudk