Introduce handler resolver - #327
Conversation
vjik
commented
Aug 14, 2026
| Q | A |
|---|---|
| Is bugfix? | ❌ |
| New feature? | ❌ |
| Breaks BC? | ✔️ |
| Tests pass? | ✔️ |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #327 +/- ##
=========================================
Coverage 92.51% 92.51%
- Complexity 379 381 +2
=========================================
Files 55 59 +4
Lines 988 1015 +27
=========================================
+ Hits 914 939 +25
- Misses 74 76 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Duplicates the new check on line 40
There was a problem hiding this comment.
CallableFactory is used in MiddlewareFactory also. Left for future refactoring.
There was a problem hiding this comment.
@vjik the same check is at line 40 already so this one is not reachable, it seems.
| } | ||
| } | ||
|
|
||
| public function testHandlerNotFoundInContainer(): void |
There was a problem hiding this comment.
Is it tested in a different way now?
There was a problem hiding this comment.
HandlerResolverTest::testResolveThrowsWhenHandlerNotFoundInContainer()
| $worker->process($message, $queueName); | ||
| } | ||
|
|
||
| public function testHandlerInContainerNotImplementingInterface(): void |
There was a problem hiding this comment.
Is it tested in a different way now?
There was a problem hiding this comment.
HandlerResolverTest::testResolveThrowsWhenHandlerInContainerNotImplementingInterface()
| public function resolve(string $messageType): HandlerInterface | ||
| { | ||
| if ($messageType === '') { | ||
| throw new LogicException('Message type cannot be empty.'); |
There was a problem hiding this comment.
This one won't be caught in the Worker:
$handler = $this->handlerResolver->resolve($message->getType());So pushing a message with empty type in the queue would kill the whole consumer. It will get stuck repeating indefinitely and erroring because the message is never removed from the queue.
There was a problem hiding this comment.
Can be fixed in another PR if it fits better. But then need to create a separate pull request or an issue.