Repository navigation
Reduce code duplication and improve architectural consistency (Issue #28) - #45
Merged
Merged
Conversation
Add lockAcquired, lockFailed, lockReleased, lockRestored, and lockLost methods to EventOrchestrator to centralize lock event dispatching. Includes comprehensive test coverage. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Replace direct EventDispatcher usage with EventOrchestrator for architectural consistency. Extract duplicate lock acquisition and failure dispatch logic into private helper methods (recordLockAcquisition, dispatchLockFailed). Reduces code duplication and aligns LockManager with other services (GateEvaluationService, ActionExecutionService). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Update StateWorker to pass EventOrchestrator to LockManager constructor, completing the architectural consistency refactoring. Add PHPMD suppressions for Orchestrator pattern (TooManyPublicMethods, CouplingBetweenObjects) and update PHPStan baseline. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Apply PHP-CS-Fixer import ordering fixes to test files. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.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.
Summary
Addresses #28 by eliminating code duplication in
LockManagerand achieving architectural consistency across all services.Changes Made
1. EventOrchestrator Lock Event Methods (Commit: 89fc07f)
EventOrchestrator:lockAcquired(),lockFailed(),lockReleased(),lockRestored(),lockLost()EventOrchestratorTest)2. LockManager Refactoring (Commit: 6eaf714)
EventDispatcherusage withEventOrchestratorfor consistencyrecordLockAcquisition()- eliminates 2 duplicate blocks (lines 62-68, 263-268)dispatchLockFailed()- eliminates 3 duplicate blocks (handleFailFast, handleSkip, handleWait)LockManagerTestto useEventOrchestratormocks3. StateWorker Integration (Commit: 736a523)
StateWorkerconstructor to passEventOrchestrator(notEventDispatcher) toLockManagerEventOrchestratorGateEvaluationService✓ActionExecutionService✓LockManager✓ (was usingEventDispatcherdirectly)4. Quality Fixes (Commits: 736a523, 4bb0a58)
Impact
Code Quality:
Testing:
Architecture:
Test Plan
make check- All quality checks passmake test- All 401 tests passRelated Issues
Closes #28
🤖 Generated with Claude Code