13B: Notices split into a writer and a presenter - #22
Open
nikolaystrikhar wants to merge 2 commits into
Open
Conversation
Notices\Queue was two jobs and a wrong name. It never held the queue -- Store does -- and it answered both "what does this notice say" and "who may see the pending set, and is it gone once they have". Those change for different reasons, and a host already running its own notices library has an opinion about the first and none about the second. Notices\Writer takes Store and words the notices, behind Writer_Interface, which is what a host rebinds. Notices\Presenter takes Store and Renderer and does the render-then-clear, with the activate_plugins gate that gua...(truncated)
nikolaystrikhar
force-pushed
the
13-activation
branch
from
August 13, 2026 10:34
7621eba to
bac107a
Compare
nikolaystrikhar
force-pushed
the
13A-notices-split
branch
from
August 13, 2026 10:34
b110132 to
e23b692
Compare
Every new PHP file declares strict_types, so the rule arrives with the file rather than as a sweep over it afterwards. PR 21 covers everything that already existed on main. The three files this branch renames count as new here. Writer, Writer_Interface and Spy_Writer are new paths that main has never carried, so waiting for the rename to inherit the declare from the file it came from would leave them without one for as long as PR 21 is unmerged -- and leave Presenter, added outright beside them, declaring it already.
nikolaystrikhar
force-pushed
the
13-activation
branch
from
August 13, 2026 11:01
bac107a to
0d876a0
Compare
nikolaystrikhar
force-pushed
the
13A-notices-split
branch
from
August 13, 2026 11:01
e23b692 to
b359085
Compare
d4mation
approved these changes
Aug 14, 2026
d4mation
left a comment
There was a problem hiding this comment.
I don't know if I'm 100% sold on the name Presenter, but I do agree with the overall split of concerns :)
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.
What:
Notices\Queuesplits intoNotices\Writer(words a notice, stores it underslug:type, behind the newWriter_Interface) andNotices\Presenter(theactivate_pluginsgate and the render-then-clear, bound by class name);Absorber::notices()returns the writer andAbsorber::render_notices()resolves the presenter.Usage:
Why this way:
The name was wrong and the class was two jobs.
Queuenever held the queue —Storedoes — and it answered both "what does this notice say" and "who may see the pending set, and is it gone once they have". A host already running its own notices library has an opinion about the first and none about the second.Only the writer earns a contract. Nothing in the library dispatches on how a notice reaches the screen: the
all_admin_noticestrampoline is the presenter's only caller, so a host that wants none of our rendering takes that callback off rather than binding an implementation that does nothing.The capability check goes with render-and-clear, not with the markup. It guards the clearing as much as the drawing, so deciding those separately would let a user who may not see the queue destroy it anyway, through a class that never checked.
No behaviour changes. It is a move, which is why it exceeds the usual source-file cap.