Problem/Motivation
See #3483037: [META] Add return types to hook implementations
Steps to reproduce
Find all occurrences in the baseline:
grep "Function .*_update_last_removed\\\\.* has no return type specified" core/.phpstan-baseline.php
Proposed resolution
Add : int to each of them.
This nifty command will find and replace all occurrences that come shortly after "Implements hook_update_last_removed()":
find . -type f -exec sed -i '/Implements hook_update_last_removed()/,/\(function .*_update_last_removed(.*)\) *{/!b;/\(function .*_update_last_removed(.*)\) *{/s/\(function .*_update_last_removed(.*)\) *{/\1: array {/' {} +
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3483050
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-update-last-removed
changes, plain diff MR !9928
Comments
Comment #3
mstrelan commentedComment #4
bbralaAnother lveoly clearnup. Starting to repeat myself, but changes look good. When lookin in code, this is exactly what should have been changes. See no missed code. Count didnt add up initially, but that is because of the string in "update_test_last_removed.into.yml".
Comment #5
quietone commentedI too applied the diff and searched. I found all instances fixed but this needs to be rebased.
Comment #6
mstrelan commentedPostponing on #3483040: Add array return type to all hook_removed_post_updates implementations as it doesn't make sense to rebase each of these, let's do one at a time.
Comment #7
mstrelan commentedNeeds a re-roll
Comment #8
Anonymous (not verified) commentedThe issue seems to be worked on correctly and
: intwas added to all the required instances. The target branch is 56 commits behind the source branch and thus needs to be rebased.Comment #9
mstrelan commentedComment #10
Anonymous (not verified) commentedHi @mstrelan
The pipeline you ran after rebasing is failing the PHPUnit (Functional) test.
Please take a look.
Comment #11
mstrelan commentedThanks, but these were known random failures, unrelated to this issue. I've retried the pipeline and it passed.
Comment #12
Anonymous (not verified) commented@mstrelan
Didn't know that those were known random failures. I thought some PHPUnit tests were failing causing the pipeline to fail and left a comment for you to look into it without checking further!
The pipeline is all green now!
The Changes look good, int return type was added to all hook_update_last_removed implementations and The baseline was updated.
Moving it to RTBC.
Comment #13
catchNeeds a rebase.
Comment #14
nicxvan commentedI did #3483065: Add void return type to all hook_form_alter, hook_form_FORM_ID_alter and hook_form_BASE_FORM_ID_alter implementations first , might as well wait until that gets in before doing this one.
Comment #15
nicxvan commentedCredit
Comment #16
Anonymous (not verified) commented@nicxvan
The Rebase look fine, int return type was added to all hook_update_last_removed implementations and The baseline was updated and all tests are green.
Moving it to RTBC. Great work
Comment #19
catchCommitted/pushed to 11.x and cherry-picked to 11.1.x thanks!
Comment #21
Anonymous (not verified) commentedHi @catch,
I have been actively following and testing the issue to confirm its resolution. Once I verified that the issue was resolved, I also moved it to the "Reviewed and Tested by Community" state.
As I contributed to this process, I would appreciate it if my effort could be acknowledged with a credit. This recognition would be highly motivating and encourage me to continue contributing.
Thank you for your attention to this matter. I look forward to your response.
Best regards,
Akul
Comment #22
catch@akulsaxena there's not enough in this issue for an RTBC to count towards issue credit. Sometimes an RTBC can, but it would need to be a more complex issue (and more complex RTBC).
See this page for some examples of what does and doesn't receive issue credit.
https://www.drupal.org/about/core/policies/maintainers/how-is-credit-gra...