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.

http://us3.php.net/manual/en/language.oop5.typehinting.php

CommentFileSizeAuthor
#1 type_hinting.patch21.94 KBfalcon
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

falcon’s picture

FileSize
21.94 KB

The 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.

falcon’s picture

Status: Active » Fixed
turadg’s picture

Status: Fixed » Needs work

I'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.

falcon’s picture

Version: 6.x-4.x-dev » 6.x-5.x-dev
Status: Needs work » Postponed
djdevin’s picture

Component: Code » Code - Quiz core
Issue summary: View changes
Status: Postponed » Closed (outdated)

This 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.