Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Type hinting will make clear to the programmer how to use the methods and will make aberrant uses caught more quickly before they lead to other sneaky errors.
Comment | File | Size | Author |
---|---|---|---|
#1 | type_hinting.patch | 21.94 KB | falcon |
Comments
Comment #1
falcon CreditAttribution: falcon commentedThe php type hinting isn't very useful to us IMO. Hopefully php will support type hinting for primitive types in the future. Attached is a patch showing how type hinting has been added to the question-types.
Comment #2
falcon CreditAttribution: falcon commentedComment #3
turadg CreditAttribution: turadg commentedI'm reopening this since there are a lot more signatures that can use it.
Unfortunately PHP probably won't ever have type hinting for scalars. We could start using asserts though. They don't cost performance in production (assuming assertion checking is turned off) and they act as type documentation.
Comment #4
falcon CreditAttribution: falcon commentedComment #5
djdevinThis issue is being closed because it was filed against a version that is no longer supported. If the issue still persists in the latest version of Quiz, please open a new issue.