Fix module sort comparator and drop Drupal 8/9 dead code in autoloader - #1036
Draft
mglaman wants to merge 1 commit into
Draft
Fix module sort comparator and drop Drupal 8/9 dead code in autoloader#1036mglaman wants to merge 1 commit into
mglaman wants to merge 1 commit into
Conversation
mglaman
force-pushed
the
audit/1d-autoloader-cleanup
branch
from
August 5, 2026 17:15
8463308 to
af47a4d
Compare
mglaman
force-pushed
the
audit/1d-autoloader-cleanup
branch
from
August 5, 2026 19:13
af47a4d to
822edb0
Compare
The usort callback never returned a negative value, so test-module ordering was implementation-defined. Replace it with a valid comparator that sorts _test extensions last. Remove the PhpUnit8 ClassWriter shim (removed in Drupal 10) and the Drush 8 directory-depth branch (composer requires drush ^11 || ^12 || ^13). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mglaman
force-pushed
the
audit/1d-autoloader-cleanup
branch
from
August 5, 2026 19:33
822edb0 to
9bac357
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 5 of 9 in the legacy-code audit stack (on top of #1035).
What changed
DrupalAutoloadernever returned a negative value and ignored its second operand, so test-module ordering was implementation-defined. Replaced with a valid comparator that reliably sorts_testextensions last, keeping their namespaces and services from taking precedence.PhpUnit8\ClassWritershim (the class was removed in Drupal 10) and the Drush 8 directory-depth branch (composer requires drush ^11 || ^12 || ^13).Testing
Full suite, self-analysis, and phpcs are green.
🤖 Generated with Claude Code