Fix latent bugs surfaced by the legacy-code audit - #1035
Open
mglaman wants to merge 1 commit into
Open
Conversation
mglaman
force-pushed
the
audit/1c-latent-fixes
branch
from
August 5, 2026 17:15
bd2e6fc to
8c90f35
Compare
mglaman
force-pushed
the
audit/1c-latent-fixes
branch
from
August 5, 2026 19:13
8c90f35 to
33d7c0f
Compare
- ExtensionDiscovery::sort(): extensions under an unknown profiles/ directory left holes in the origins/profiles arrays, making array_multisort() fail on unequal array sizes. - Extension::parseInfo(): missing closing quote in the exception message. - EntityFieldsViaMagicReflectionExtension: throw PHPStan's ShouldNotHappenException instead of LogicException so failures are reported as internal errors with context. - PluginManagerSetsCacheBackendRule: return no errors instead of throwing when outside a class, and delete the dead $cacheKey block whose result was never read. - DiscouragedFunctionsRule: drop 'eval' — it is a language construct and never parses as a function call. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mglaman
force-pushed
the
audit/1c-latent-fixes
branch
from
August 5, 2026 19:33
33d7c0f to
f7189dd
Compare
mglaman
marked this pull request as ready for review
August 5, 2026 19:34
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 4 of 9 in the legacy-code audit stack (on top of #1034). Small latent bugs surfaced by auditing the oldest code (2018–2019).
What changed
ExtensionDiscovery::sort(): extensions under an unknownprofiles/directory left holes in the origins/profiles arrays, makingarray_multisort()fail on unequal array sizes.Extension::parseInfo(): missing closing quote in the exception message.EntityFieldsViaMagicReflectionExtension: throw PHPStan'sShouldNotHappenExceptioninstead of a bareLogicExceptionso failures surface as internal errors with context.PluginManagerSetsCacheBackendRule: return no errors instead of throwing when outside a class, and delete the dead$cacheKeyblock whose result was never read.DiscouragedFunctionsRule: drop'eval'— it is a language construct and never parses as a function call.Testing
Full suite, self-analysis, and phpcs are green.
🤖 Generated with Claude Code