Problem/Motivation
Follow up from #3323990: Migrate Drupal reports wrong version of Drupal if pointed at a Drupal 9 or 10 database from @benjifisher
simplify getLegacyDrupalVersion() further. Copying my suggestions from there:
Put a lot less in the try block.
Return early instead of assigning to $version_string and then returning it at the end
Steps to reproduce
NA
Proposed resolution
From the quote*
- Put a lot less in the try block.
- Return early instead of assigning to $version_string and then returning it at the end
Remaining tasks
Implement
Review
User interface changes
NA
API changes
NA
Data model changes
NA
Release notes snippet
NA
Issue fork drupal-3437178
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 #4
immaculatexavier commentedCreated MR for the proposed resolution, But PHPUnit test fails.
Comment #6
quietone commentedComment #7
smustgrave commentedForgot about this one.
But refactoring seems fine and follows what was proposed in the original issue.
Comment #8
alexpottThe new code seems to have duplicated a comment. Also I left a suggestion for further refactoring on the MR.
Comment #9
quietone commentedComment #10
smustgrave commentedAppears suggestion from #alexpott has been addressed.
Comment #11
alexpottCommitted and pushed 4881479469 to 11.x and 6b2ecdbb73 to 10.3.x. Thanks!