Problem/Motivation

The method findMatchingRedirect of RedirectRepository says it always returns Redirect but it actually return NULL in cases no redirect was found. This incorrect annotation can cause developers to miss handling NULL errors leading to WSODs.

Steps to reproduce

Proposed resolution

Annotate the PHPDoc @return type with |NULL and update the related comment. This ensures tools like PHPStan can properly warn users.

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork redirect-3309603

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

Kingdutch created an issue. See original summary.

kingdutch’s picture

Status: Active » Needs review
daniel.bosen’s picture

Status: Needs review » Reviewed & tested by the community

lgtm

kristen pol’s picture

Assigned: Unassigned » kristen pol

Assigning to myself as I'm triaging all RTBC issues.

kristen pol’s picture

Thanks for the issue and patch and the review. I've checked the code and do see that NULL can be returned. I have updated the patch to follow core coding standards and will merge shortly.

  • Kristen Pol committed 4102c845 on 8.x-1.x
    Issue #3309603 by Kingdutch, Kristen Pol, daniel.bosen: Incorrect type...
kristen pol’s picture

Assigned: kristen pol » Unassigned
Status: Reviewed & tested by the community » Fixed

Marking fixed.

Status: Fixed » Closed (fixed)

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