Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
PHPStan is currently skipping multiple #should return .* but return statement is missing#
errors.
Steps to reproduce
Fix the errors in test code, clean up the baseline.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Issue fork drupal-3309047
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:
- 3309047-fix-should-return changes, plain diff MR !2751
Comments
Comment #3
mondrakeComment #4
SpokjeLooks like you missed three removals from the baseline?
Comment #5
mondrake#4 thanks! Actually, the three misses were due to allowing a null return type (consistently with what the docs were saying)
This mere addition meant the PHPStan error not to appear any longer. I have anyway also adjusted the reported methods to explicitly return NULL in case the derivative does not exist, to imporve readibility.
Comment #6
SpokjeI've added the "per usual" annoying nitpicks, as before: Not blocking at all, close them if you don't agree.
Change them if you agree.
In both cases: I'm happy to RTBC this.
Comment #7
mondrakeThanks @Spokje
Comment #8
Spokje- All my nitpicks are addressed (or refused for a very good reason).
- Code changes make sense (see also #5)
RTBC if TestBot agrees.
Comment #9
alexpottAdded some review comments to gitlab.
Comment #10
mondrakeComment #11
mondrakerebased
Comment #12
Spokje- Random JS test failures that are not related to this MR
- All concerns of both @longwave and @alexpott were addressed.
RTBC for me.
Comment #14
alexpottBackported the changes to 9.4.x (apart from the phpstan baseline) because this is test code or docs.