API page: https://api.drupal.org/api/drupal/core%21modules%21user%21src%21UserData...
Between the comments in the code for UserData::get(), there are some similar to the following one.
// If $module and $uid was passed, return the name/value pairs.
It should use were, since A and B is considered plural, in English.
// If $module and $uid were passed, return the name/value pairs.
I would also use the similar wording using for the last comment.
// If $module and $uid were passed, return data keyed by name.
Similarly, I would do for the following comments.
// If $module, $uid, and $name was passed, return the value.
// If $module and $name was passed, return the uid/value pairs.
The first comment needs just the verb to be corrected.
Comments
Comment #2
avpadernoI hope I choose the correct component for the issue. Since it's about comments in the code, I considered them inlined documentation for the code.
Comment #3
avpadernoComment #4
dinesh18 commentedYes you are correct. Patch looks good to me.
Changing the status to RTBC.
Comment #5
xjmUpdating the issue title to reflect the full scope including rewriting the comments.
Comment #8
xjmSince automated checking can't catch grammatical errors, I agree that it's fine to just fix these three comments as in the patch.
I read over the code in
UserData::get()as well as the method documentation forUserDataInterface::get(), and confirmed that the updated comments accurately describe what is happening. (Also, um, yeesh. The mixed return value for this method is, um, scary. We should refactor that, but that's out of scope here.)Committed to 8.4.x, and cherry-picked to 8.3.x since as a documentation improvement it is eligible for backport. Thanks!
Comment #9
xjmAdding the related issues @catch and @larowlan rustled up about the needed refactoring.