Seal the UnaryOperator/Negative hierarchy (@internal + finalize) - #100
Merged
MidnightDesign merged 1 commit intoJul 23, 2026
Conversation
Mark UnaryOperator and Negative @internal + @psalm-internal, and finalize UnaryOperator::__toString() and equals() to match the already-sealed BinaryOperator. This removes Negative/UnaryOperator and their inherited members from the public API. The old docblock documented this as the intended end state but deferred it to "the next major", pointing at a dangling eventjet/ausdruck#83. Per docs/BACKWARD-COMPATIBILITY.md the minor is the 0.x compatibility boundary, so 0.3.0 is the breaking window this belongs in. Rewrote the docblock accordingly, dropping the now-obsolete not-yet-internal rationale and keeping the still-true token()-is-protected note. Not was already born @internal, so the hierarchy is now sealed consistently with BinaryOperator. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Aqoim7pUMKSoPCe4i9h9F
MidnightDesign
deleted the
95-seal-the-unaryoperatornegative-hierarchy-internal-+-finalize-replaces-dangling-83
branch
July 23, 2026 14:40
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.
Closes #95.
Scoped for the 0.3.0 breaking release.
What changed
src/UnaryOperator.php@internal+@psalm-internal Eventjet\Ausdruck, taking the base off the promised surface.__toString()andequals()to match the already-sealedBinaryOperator.$expression-name-is-fixed and methods-can't-be-final constraints) and the dangling#83/ "next major" deferral. Kept the still-truetoken()-is-protected rationale.src/Negative.php@internal+@psalm-internal Eventjet\Ausdruck.Notwas already born@internal, so the hierarchy is now sealed consistently withBinaryOperator.Why now, not "next major"
The old docblock deferred sealing to a literal 1.0 and pointed at a dangling
eventjet/ausdruck#83(no such issue/PR exists). Perdocs/BACKWARD-COMPATIBILITY.md, on the0.xline the minor is the compatibility boundary — 0.3.0 is the breaking window, so this belongs here rather than waiting years for 1.0.BC impact
Structural break: removes
Negative/UnaryOperatorand their inherited members from the public API and finalizes previously-published methods. This is the "finalizing a published method breaks BC even on a final class" case and can only land in a breaking minor. Roave's BC checker will (correctly) flag it.Verification
cs-check,psalm,phpstan,phpunit(1131 tests) — all green.infection-diff— 0 mutations on the changed lines (docblock +finalkeywords carry no mutable logic), passes with--ignore-msi-with-no-mutations.🤖 Generated with Claude Code
https://claude.ai/code/session_013Aqoim7pUMKSoPCe4i9h9F