Commander
Commander copied to clipboard
Validation is being fired twice when using ValidationCommandBus
Hi!
I've noticed a strange bug when trying to use ValidationCommandBus
. It appears that when executing command with this bus this decorator is firing validator then using the default command bus which is bound to another ValidationCommandBus
via the service provider.
$this->app->bindShared('Laracasts\Commander\CommandBus', function ($app)
{
$default = $app->make('Laracasts\Commander\DefaultCommandBus');
$translator = $app->make('Laracasts\Commander\CommandTranslator');
return new ValidationCommandBus($default, $app, $translator);
});
This code binds the interface to implementation of ValidationCommandBus so it is looping here for me. The version is 1.3.10.