Repository navigation
docs: clarify UnitOfWork::active() wording - #45
Merged
Merged
Conversation
Closes #44 Co-Authored-By: Claude Opus 5.5 <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.
Closes #44
The
active()docblock on theUnitOfWorkport said it returns true only while a callback passed toexecute()is running. That is narrower than real implementations can guarantee: a database-backed adapter (e.g. checkingtransactionLevel() > 0) also reports a transaction started outsideexecute()on the same connection.This changes the wording to describe an open transaction that work will be committed or rolled back with, and states that implementations MAY return true for a transaction not started by the unit of work if they cannot distinguish it.
src/Contracts/Application/Ports/UnitOfWork.php: updated theactive()docblockdocs/guide/application/units-of-work.md: updated the copy of the interface to matchdocs/guide/upgrade.md: updated the 6.x → 7.x upgrade note to matchThere are no code changes.
FakeUnitOfWork(true only duringexecute()) already satisfies the new wording. I didn't add a changelog entry because the methods are unreleased and the existingUnreleased Next Majorentry still applies.🤖 Generated with Claude Code