Skip to content

Follow ReportManagement into FOG\Pages - #32

Merged
mastacontrola merged 1 commit into
mainfrom
qualify-pages-namespace
Aug 30, 2026
Merged

Follow ReportManagement into FOG\Pages#32
mastacontrola merged 1 commit into
mainfrom
qualify-pages-namespace

Conversation

@mastacontrola

Copy link
Copy Markdown
Member

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 into src/{Pages,Hooks,Reports,Events}. The only core class this tree
names by its flat spelling moved with them: \FOG\ReportManagement is now
\FOG\Pages\ReportManagement.

Eight report classes extend it. Without this change 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.

This PR on its own is a no-op against today's core (nothing resolves
FOG\Pages\ReportManagement yet), so the order is: merge #1528, merge this, then cut a
fog-plugins release
so the fix actually reaches installs.

tests/core-references-are-qualified.test.php did not catch this, and cannot

It 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.php

Loses its lib/{pages,hooks,reports,events} pass, which read the directories the move
emptied. Its src/ walk already maps these classes, and maps them 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.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VTEiBnDpNrgzu1tSqt1318

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>
@mastacontrola
mastacontrola merged commit 388940a into main Aug 30, 2026
2 checks passed
@mastacontrola
mastacontrola deleted the qualify-pages-namespace branch August 30, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant