Problem/Motivation
Param definition in function comment is missing a type. This is important because many code editors use the functional documentation to describe parameters when you're using the function.
Proposed resolution
Add type to the param
Remaining tasks
Submit a patch
User interface changes
None
API changes
None - just improved documentation
Data model changes
None - just improved documentation
Comment | File | Size | Author |
---|---|---|---|
#2 | missing_param_type_for-2600004-2.patch | 530 bytes | koppie |
Comments
Comment #2
koppie CreditAttribution: koppie at Pantheon commentedI've rolled a patch that adds the type to the param. Please review. :-)
Comment #3
YesCT CreditAttribution: YesCT commentedyeah, I think string is the correct type.
thanks!
Comment #4
YesCT CreditAttribution: YesCT commentedallowed and adding the tag per https://www.drupal.org/core/d8-allowed-changes#rc
Comment #6
xjmThanks @koppie for the patch!
I reviewed this to confirm that the
$name
parameter is only ever a string. It's used as an array key ingetOption()
, which means it needs to be a string or integer, and all the calls togetOption()
in core pass a string literal. Also, the documented usage for the parameter (ont()
) says this:So based on that, this is the correct parameter type documentation.
As a docs-only change, this is RC eligible. Committed and pushed to 8.0.x. Thanks!
Comment #7
xjm(Fixing issue credit. crossposts-- Thanks @YesCT).