Problem/Motivation

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

Steps to reproduce

Find all occurrences in the baseline:

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

Proposed resolution

Add : void to each of them.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#8 3483065-nr-bot.txt90 bytesneeds-review-queue-bot

Issue fork drupal-3483065

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
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Seems straight forward. Applied the MR and did a search for those functions and believe all have been hit.

quietone’s picture

Status: Reviewed & tested by the community » Needs work

Applied the diff then searched using the grep in the IS and that these have not been changed. Why is that?

$ grep "Function .*_form_.*_alter\\\\.* has no return type specified" core/.phpstan-baseline.php
        'message' => '#^Function content_moderation_entity_form_display_alter\\(\\) has no return type specified\\.$#',
        'message' => '#^Function inline_form_errors_element_info_alter\\(\\) has no return type specified\\.$#',
        'message' => '#^Function layout_builder_entity_form_display_alter\\(\\) has no return type specified\\.$#',
        'message' => '#^Function media_library_form_overwrite_test_media_source_info_alter\\(\\) has no return type specified\\.$#',
        'message' => '#^Function entity_test_entity_form_display_alter\\(\\) has no return type specified\\.$#',
        'message' => '#^Function entity_test_entity_form_mode_alter\\(\\) has no return type specified\\.$#',
        'message' => '#^Function entity_test_entity_form_mode_info_alter\\(\\) has no return type specified\\.$#',
        'message' => '#^Function claro_theme_suggestions_form_element_alter\\(\\) has no return type specified\\.$#',
mstrelan’s picture

None of the functions in #5 are form alters, but their names are similar to form alters. For example some of them implement hook_entity_form_display_alter and others have the word "form" in the module name and alter some other hook.

nicxvan’s picture

Status: Needs work » Reviewed & tested by the community

Took a look and can confirm the identified errors are not form alters.

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.

nicxvan’s picture

Status: Needs work » Needs review
godotislate’s picture

Status: Needs review » Reviewed & tested by the community

Rebase in baseline looks fine, and tests are green.

nicxvan’s picture

Ok, gotta rebase again, the entity type alter just got in

godotislate’s picture

Rebased baseline still looks good, leaving in RTBC.

  • catch committed 5e722c42 on 11.1.x
    Issue #3483065 by nicxvan, mstrelan: Add void return type to all...

  • catch committed 496bdd96 on 11.x
    Issue #3483065 by nicxvan, 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.