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.
This is a sub-issue of #1800046: [META] Add missing type hinting to core docblocks, fix Drupal.Commenting.FunctionComment.Missing* focused on correctly adding @param and @return type hinting to the Node module.
Documentation patches that include type hinting are time consuming to both review and commit because one must dig into the actual code to confirm that the type hints are both correct and complete. Hence, please be patient and try to limit type hint patches to covering only a limited number of docblocks (20-25 as a guess).
How To Review This Issue
- Attempt to apply the patch to see if it needs a reroll.
- Use the phpcs one-liner to evaluate whether all the relevant standards errors have been resolved: https://gist.github.com/paul-m/227822ac7723b0e90647
- Look at each change and determine whether the type hint is correct.
Related sprint issues:
Comment | File | Size | Author |
---|---|---|---|
#25 | 1800546-25.patch | 12.81 KB | idebr |
#25 | interdiff-18-25.txt | 4.87 KB | idebr |
Comments
Comment #0.0
Lars Toomre CreditAttribution: Lars Toomre commentedAdded tags to Related issues title.
Comment #1
Lars Toomre CreditAttribution: Lars Toomre commentedAdded a patch at #1313980-71: Clean up API docs for node module that is focused on docblock corrections and modifications. Once that has been committed, my plan is to add a patch here that adds missing type hinting to @param and @return directives as appropriate.
Comment #2
Lars Toomre CreditAttribution: Lars Toomre commentedAttached is a patch that adds type hinting to the hook examples in node.api.php. This is untested locally, but should pass since all of the changes are in comments. Let's see what the bot thinks.
Comment #2.0
Lars Toomre CreditAttribution: Lars Toomre commentedCorrected the issue tags.
Comment #3
xjm(Merging "node system" and "node.module" components for 8.x; disregard.)
Comment #4
Jalandhar CreditAttribution: Jalandhar commentedPatch no longer applies. It needs reroll.
Comment #5
Jalandhar CreditAttribution: Jalandhar commentedThere is an inconsistency in the addition of type hinting in node.api.php file. Fixed the issues related to it and updating the patch.
Comment #6
Mile23Comment #7
Mile23Amazingly, the patch in #5 still applies.
It doesn't catch all the needed type hints, though.
Comment #8
adci_contributor CreditAttribution: adci_contributor commentedPlease review
Comment #9
Mile23Thanks.
So, it's the whole module we're dealing with, not just the api file.
phpcs says to have a look in:
Comment #10
Mile23Reroll of #8, plus a bunch more work.
This should get all missing parameter hints.
Comment #11
Mile23Comment #12
Mile23Comment #13
nitvirus CreditAttribution: nitvirus at Srijan | A Material+ Company commentedPatch is working.
Comment #15
no_angel CreditAttribution: no_angel as a volunteer commentedComment #16
no_angel CreditAttribution: no_angel as a volunteer commentedComment #17
no_angel CreditAttribution: no_angel as a volunteer commentedComment #18
Mile23Reroll of #10, plus one error I found.
Based on the gist in the issue summary, no remaining @param or @return type hinting errors.
Comment #19
Mile23As with the other issues for the parent meta, moving this to 8.0.x. Patch still applies cleanly.
Comment #25
idebr CreditAttribution: idebr at iO commentedReroll against 8.6.x.
Fixed the following sniffs in the Node module:
Comment #31
quietone CreditAttribution: quietone as a volunteer commentedThis work is now being done by sniff. The work here is now in #3207949: Fix Drupal.Commenting.FunctionComment.MissingParamType so closing this as a duplicate. I've identified credit to add over there, let me know if I got it wrong.