Problem/Motivation
See #3483037: [META] Add return types to hook implementations
All info hooks should return array, except hook_config_translation_info which takes the $info param as a reference.
Steps to reproduce
Proposed resolution
Add array return to the following hook implementations:
- hook_entity_bundle_info
- hook_entity_base_field_info
- hook_entity_bundle_field_info
- hook_entity_field_storage_info
- hook_entity_extra_field_info
- hook_hook_info
- hook_updater_info
- hook_filetransfer_info
- hook_token_info
- hook_language_types_info
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3488841
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3488841-info-hooks
changes, plain diff MR !10282
Comments
Comment #3
mstrelan commentedComment #4
nicxvan commentedLooks good! Baseline looks right too.
Comment #5
quietone commentedI left some questions in the MR. Also, why are these not changed?
Comment #6
lavanyatalwar commentedComment #7
mstrelan commentedResponded to some of the MR feedback, need further advice. Will look at the entity.api.php feedback too, it wasn't loading in the MR though.
Re #5:
*_hook_infohooks were missed because my script was looking for a #[Hook] attribute in Hook classes. Could possibly be skipped due to #2233261: Deprecate hook_hook_info groups, mark hook_hook_info() for deletiontest_module_hook_infois actually in a heredoc string for writing a .module in a test, but I guess it could be included tooHookCollectorPassis just a comment talking about info hooksComment #8
mstrelan commentedAddressed most feedback, 2 outstanding items in the MR for re-review.
Comment #9
mstrelan commentedNeeds rebase
Comment #10
Anonymous (not verified) commentedakulsaxena made their first commit to this issue’s fork.
Comment #11
Anonymous (not verified) commentedHi @mstrelan
I resolved the Merge conflict in Baseline and Rebased the branch to the latest.
But the PHPSTAN pipeline shows some error in Baseline.
Can you please look into it
Comment #12
mstrelan commentedBest not to manually resolve conflicts in the baseline, just regenerate it.
Comment #13
Anonymous (not verified) commentedComment #14
mstrelan commentedRebased with these steps:
git rebase -i 11.x./vendor/bin/phpstan --configuration=core/phpstan.neon.dist --generate-baseline=core/.phpstan-baseline.phpgit add core/.phpstan-baseline.phpComment #15
nicxvan commentedThose steps good but you mean --force-with-lease right?
Comment #16
Anonymous (not verified) commentedRebased
Comment #17
Anonymous (not verified) commentedPipeline passed with all no errors/warnings
Comment #18
smustgrave commented@akulsaxena unless the issue doesn't apply or the review bot kicks back a rebase is not needed.
Appears to be 2 open threads so leaving in review. As far as the workspace thread, even though we know workspaces is being updated think we have to make sure nothing bad is introduced here as we don't fully know when those overhaul tickets will land.
Comment #19
smustgrave commentedOkay this has sat for a bit.
The first thread appears to have an open discussion.
For the workspace one should we postpone till workspace is refactored?
Comment #20
mstrelan commentedRebased the MR.
I have refactored this as requested.
Don't think so, there is no harm in leaving it in.
Comment #21
smustgrave commentedNow it actually does need a rebase.
Comment #23
shalini_jha commentedI have rebased the MR, resolved the conflict, and followed the steps outlined in #14. I have also verified the PHP Stan baseline. Since the pipeline is now green, Checked the threads , but nothing open so moving this back to 'Needs Review'.
Comment #24
smustgrave commentedNeeds a rebase.
Comment #25
shalini_jha commentedI am working on it
Comment #26
shalini_jha commentedRebase & fixed conflict,moving this NR.
Comment #27
smustgrave commentedThis rebase seems to hold for now.
Comment #28
quietone commentedSorry, needs another rebase.
Comment #29
shalini_jha commentedRebased this without encountering any conflicts
Comment #30
smustgrave commentedSorry still needs a rebase
If you are another contributor eager to jump in, please allow the previous poster at 8 hours to respond to feedback first, so they have the opportunity to finish what they started!
Comment #31
shalini_jha commentedRebased & fixed conflicts :)
Comment #32
Anonymous (not verified) commentedThe rebase seems to hold for now
Can be moved to RTBC now, i worked on this issue so cant move it to RTBC, will wait for someone else to RTBC this.
Comment #33
smustgrave commentedThanks @shalini_jha!
Comment #34
quietone commentedBefore applying the diff these are the info hooks with a return type. The void agrees with the Issue Summary.
After applying the diff and search for info hooks with an array return, there is just the config one, as expected.
Comment #35
quietone commentedCommitted 873f84f and pushed to 11.x. Thanks!
Comment #37
quietone commentedComment #40
nicxvan commented