Skip to content

docs: clarify UnitOfWork::active() wording - #45

Merged
lindyhopchris merged 1 commit into
nextfrom
fix/unit-of-work-active-docblock
Nov 14, 2026
Merged

lindyhopchris merged 1 commit into
nextfrom
fix/unit-of-work-active-docblock

Conversation

@lindyhopchris

Copy link
Copy Markdown
Member

Closes #44

The active() docblock on the UnitOfWork port said it returns true only while a callback passed to execute() is running. That is narrower than real implementations can guarantee: a database-backed adapter (e.g. checking transactionLevel() > 0) also reports a transaction started outside execute() 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 the active() docblock
  • docs/guide/application/units-of-work.md: updated the copy of the interface to match
  • docs/guide/upgrade.md: updated the 6.x → 7.x upgrade note to match

There are no code changes. FakeUnitOfWork (true only during execute()) already satisfies the new wording. I didn't add a changelog entry because the methods are unreleased and the existing Unreleased Next Major entry still applies.

🤖 Generated with Claude Code

Closes #44

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lindyhopchris lindyhopchris self-assigned this Nov 14, 2026
@lindyhopchris
lindyhopchris merged commit 7cadf49 into next Nov 14, 2026
2 checks passed
@lindyhopchris
lindyhopchris deleted the fix/unit-of-work-active-docblock branch November 14, 2026 14:45
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