Problem/Motivation
See #3483037: [META] Add return types to hook implementations
Steps to reproduce
grep -P "Function [a-zA-Z0-9_]+_update_\\d+\\\\\\\\\(\\\\\\\\\) has no return type specified" core/.phpstan-baseline.php
Proposed resolution
Add return type to the 20 functions listed in steps to reproduce. Many of these are void, some are string, some may be MarkupInterface or TranslatableMarkup.
Add return type to hook_update_N example in module.api.php
Update phpstan baseline
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3490954
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:
- 3490954-add-return-types
changes, plain diff MR !10445
Comments
Comment #2
nexusnovaz commentedIll take a look at this one
Comment #4
nexusnovaz commentedRunning the grep command, there was only 20 functions. I've updated those and pushed my changed. Please can you review MR !10445
Comment #5
mstrelan commentedChecked again and there are only 20, not 44, ever since #3490638: Add return types to update_test_* hooks. Have updated the IS to reflect that.
MR looks good, pipeline is green, 120 lines removed from baseline checks out (20 x 6 = 120). RTBC from me.
Comment #8
quietone commentedThat equivalent_update_test_update_100201 returns TranslatableMarkup is unusual but it is part of the testing.
Committed to 11.x and cherry-picked to 11.1.x
Thanks