Problem/Motivation
See #3483037: [META] Add return types to hook implementations
Steps to reproduce
Find all occurrences in the baseline:
grep "Function .*_removed_post_updates\\\\.* has no return type specified" core/.phpstan-baseline.php
Proposed resolution
Add : array to each of them.
This nifty command will find and replace all occurrences that come shortly after "Implements hook_removed_post_updates()":
find . -type f -exec sed -i '/Implements hook_removed_post_updates()/,/\(function .*_removed_post_updates(.*)\) *{/!b;/\(function .*_removed_post_updates(.*)\) *{/s/\(function .*_removed_post_updates(.*)\) *{/\1: array {/' {} +
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3483040
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:
- hook-removed-post-updates
changes, plain diff MR !9927
Comments
Comment #3
mstrelan commentedComment #4
mstrelan commentedComment #5
bbralaChanges makes sense, had a few extra hits wehen looking around for missed ones. But those hits were in
Seems to cover all bases :) Nice one.
Comment #6
quietone commentedApplied the diff and get one more
Comment #7
mstrelan commentedAh, the phpdoc comment didn't match the right format, so my
findcommand didn't find it. Have rebased, updated, and fixed the docs at the same time.Comment #8
smustgrave commentedFeedback appears to be addressed on this one.
Comment #11
catchCommitted/pushed to 11.x and cherry-picked to 11.1.x thanks!
Comment #13
dwwRetroactively crediting @mstrelan for all the work (issue, automation + MR), and @bbrala for the review.