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

Command icon 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:

Comments

mstrelan created an issue. See original summary.

mstrelan’s picture

Status: Active » Needs review
mstrelan’s picture

Issue summary: View changes
bbrala’s picture

Status: Needs review » Reviewed & tested by the community

Changes makes sense, had a few extra hits wehen looking around for missed ones. But those hits were in

system.install

Seems to cover all bases :) Nice one.

quietone’s picture

Status: Reviewed & tested by the community » Needs work

Applied the diff and get one more

$ grep "Function .*_removed_post_updates\\\\.* has no return type specified" core/.phpstan-baseline.php
        'message' => '#^Function test_theme_depending_on_modules_removed_post_updates\\(\\) has no return type specified\\.$#',
mstrelan’s picture

Status: Needs work » Needs review

Ah, the phpdoc comment didn't match the right format, so my find command didn't find it. Have rebased, updated, and fixed the docs at the same time.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Feedback appears to be addressed on this one.

  • catch committed ac590ac6 on 11.1.x
    Issue #3483040 by quietone: Add array return type to all...

  • catch committed 9028e269 on 11.x
    Issue #3483040 by quietone: Add array return type to all...
catch’s picture

Version: 11.x-dev » 11.1.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 11.x and cherry-picked to 11.1.x thanks!

dww’s picture

Retroactively crediting @mstrelan for all the work (issue, automation + MR), and @bbrala for the review.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.