Follow ReportManagement into FOG\Pages - #32
Merged
Conversation
Core bucketed the last 52 flat-namespace classes -- pages, hooks, reports and
events -- out of lib/ and into src/{Pages,Hooks,Reports,Events}, so the only
core class this tree names by its flat spelling moved:
\FOG\ReportManagement is \FOG\Pages\ReportManagement.
Eight report classes extend it. Without this they fatal with
"Class FOG\ReportManagement not found" the moment someone opens the report --
core's autoloader refuses the flat spelling and logs the correct FQCN rather
than resolving it, so the failure is legible, but it is still a failure.
tests/core-references-are-qualified.test.php does NOT catch this, and cannot:
it is a syntax gate that asks whether a class reference carries a leading
backslash, not whether the name resolves. It has no copy of core's class list
on purpose, so that it runs without a fogproject checkout beside it. It stayed
green through the whole breakage.
bin/qualify-core-references.php loses its lib/{pages,hooks,reports,events}
pass, which read the directories the move emptied. Its src/ walk already maps
these classes, and to the bucketed FQCN a plugin actually has to write --
whereas the retired pass ran afterwards and overwrote each entry with the flat
spelling. Running the tool against the moved core tree now reports nothing left
to rewrite, which is how the eight edits above were checked.
Co-Authored-By: Claude <noreply@anthropic.com>
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.
Depends on FOGProject/fogproject#1528 — merge that first
Core bucketed the last 52 flat-namespace classes — pages, hooks, reports and events —
out of
lib/and intosrc/{Pages,Hooks,Reports,Events}. The only core class this treenames by its flat spelling moved with them:
\FOG\ReportManagementis now\FOG\Pages\ReportManagement.Eight report classes extend it. Without this change they fatal with
Class "FOG\ReportManagement" not foundthe moment someone opens the report. Core'sautoloader refuses the flat spelling and logs the correct FQCN rather than resolving it,
so the failure is legible — but it is still a failure.
This PR on its own is a no-op against today's core (nothing resolves
FOG\Pages\ReportManagementyet), so the order is: merge #1528, merge this, then cut afog-plugins release so the fix actually reaches installs.
tests/core-references-are-qualified.test.phpdid not catch this, and cannotIt is a syntax gate: it asks whether a class reference carries a leading backslash,
not whether the name resolves. It deliberately holds no copy of core's class list, so
that it runs without a fogproject checkout beside it. It stayed green through the entire
breakage. Worth knowing before trusting it as coverage for a core rename.
bin/qualify-core-references.phpLoses its
lib/{pages,hooks,reports,events}pass, which read the directories the moveemptied. Its
src/walk already maps these classes, and maps them to the bucketedFQCN a plugin actually has to write — whereas the retired pass ran afterwards and
overwrote each entry with the flat spelling.
Running the tool against the moved core tree now reports nothing left to rewrite, which
is how the eight edits above were checked.
🤖 Generated with Claude Code
https://claude.ai/code/session_01VTEiBnDpNrgzu1tSqt1318