twigphp / Twig

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

Determine which types to support for `types` tag #4256

Open drjayvee opened 2 weeks ago

drjayvee commented 2 weeks ago

Following discussions in #4165, we want to determine which types (if any), Twig wants to suggest or even mandate extensions support.

There seem to be three options:

  1. Remain completely agnostic
  2. Use PHP's types: string, bool, etc
  3. Use more generic types such as stringable, iterable
  4. Use PHPStan/Psalm types
fabpot commented 2 weeks ago

It's also related to the work done here: https://github.com/twigphp/Twig/pull/4252/files#diff-6fd6db196be65abd4dcc8132c2bc70a2e0b232c4a5732f29ea26d0a09676ff74R79-R90