Documentation for types tag uses Twig types in examples instead of PHP
Specifically, "bool" => "boolean" and "int" => "number".
This aligns the types documentation with templates.rst. See #4362
Thanks, @alexander-schranz!
boolean is a valid PHPStan type, but number is not.
See https://phpstan.org/writing-php-code/phpdoc-types
Can we maybe update the example, to not use a number instead?
TwigStan will only accept PHPStan types, as it's a PHPStan analyzer.
Making this types tag too strict up front, only limits its usage in the wild.
The documentation is not up to date. PHPStan does properly understand number 🎉
I'll fix the docs.
See https://phpstan.org/r/24895f82-975a-4e08-b7b1-5da29d058ddd
Done:
- https://github.com/phpstan/phpstan/pull/11882
Do you think it's worth it to update TypesTest.php and TypesTokenParser.php ?
Thank you @drjayvee.
Not sure why Github doesn't understand this one was merged 🤷
@fabpot this happens when we squash commits but we are not allowed to push the squashed commits back to the branch from which the PR is submitted. There is no way to mark a PR as merged when performing a squash or rebase entirely locally.