-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document Twig vs PHP types #4362
Conversation
530480e
to
66e8bce
Compare
I think this one is ready, comments are welcomed. |
66e8bce
to
ac47c88
Compare
Thanks for the heads up, Fabian. I'll have a look at this tomorrow or Wednesday and will provide feedback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! 👍
ac47c88
to
aa5467c
Compare
aa5467c
to
9690e7b
Compare
LGTM as well 👍 |
Twig Type PHP Type | ||
=================== =============================== | ||
string A string or a Stringable object | ||
number An integer or a float |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the docs int
is used here: https://twig.symfony.com/doc/3.x/tags/types.html#types
Do we specify for the new feature PHP types instead of Twig types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
While the documentation states "The syntax for and contents of type strings are intentionally left out of scope", I do agree that "number" and "boolean" are better choices to align with the documentation on types.
I'll create a PR for updating the types
documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Voila: #4403
Specifically, "bool" => "boolean" and "int" => "number". This aligns the `types` documentation with templates.rst. See twigphp#4362 Thanks, @alexander-schranz!
…nstead of PHP (drjayvee) This PR was squashed before being merged into the 3.x branch. Discussion ---------- 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! Commits ------- f3e0a00 Documentation for types tag uses Twig types in examples instead of PHP
Refs #4256