
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
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
Comment #3
kingdutchComment #4
daniel.bosenlgtm
Comment #5
kristen polAssigning to myself as I'm triaging all RTBC issues.
Comment #6
kristen polThanks 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.
Comment #8
kristen polMarking fixed.