Problem/Motivation

See #3483037: [META] Add return types to hook implementations

Steps to reproduce

Find all occurrences in the baseline:

grep "Function .*_entity_type_alter\\\\.* has no return type specified" core/.phpstan-baseline.php

Proposed resolution

Add : void to each of them.

This nifty command will find and replace all occurrences that come shortly after "Implements hook_entity_type_alter()":
find . -type f -exec sed -i '/Implements hook_entity_type_alter()/,/\(function .*_entity_type_alter(.*)\) *{/!b;/\(function .*_entity_type_alter(.*)\) *{/s/\(function .*_entity_type_alter(.*)\) *{/\1: void {/' {} +

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3484249

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
needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new90 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

mstrelan’s picture

Status: Needs work » Needs review

Rebased and rebaselined

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Rebase seems good to me

needs-review-queue-bot’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new90 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

mstrelan’s picture

Issue summary: View changes
Status: Needs work » Needs review

Re-rolled

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Rebase seems good

  • catch committed 546aee1a on 11.1.x
    Issue #3484249 by mstrelan: Add void return type to all...

  • catch committed 8e261bf9 on 11.x
    Issue #3484249 by mstrelan: Add void 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!

Status: Fixed » Closed (fixed)

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