Closed sagikazarmark closed 9 years ago
@rosstuck I am willing to merge this one first and anything else afterwards. Meaning if we want to follow Bernard pattern strictly, we have to drop the single command bus thing.
Possible router registration:
<?php
class RouterSetup
{
protected $commandBus;
public function __construct($commandBus)
{
$this->commandBus = $commandBus;
}
public function registerRouter($router)
{
$router->add('League\Tactician\Command', [$this->commandBus, 'handle']);
}
}
/cc @rosstuck @henrikbjorn
I've gotta run to a client, will get back to you tonight. I need to read the rest of the other thread but I'm not sure this means dropping the single command bus aspect since that really comes down to solving the infinite loop issue. Considering this router still takes a callable, we can still flag/wrap/etc.
At any rate, let me read the other thread and get back to you this evening. :)
Yeah, actually I realised that there is a far more better way than I am currently trying with the PreventLoopRouter.
@rosstuck IIRC we agreed on this one, can I merge it?
At a high level, yes, though I thought the plan was to remove the Setup class in favor of a Receiver that implemented __invoke()
?
Ah, disregard, I see that happened in #18, my bad.
Based on discussion in #15