Commander icon indicating copy to clipboard operation
Commander copied to clipboard

Validation is being fired twice when using ValidationCommandBus

Open zaalbarxx opened this issue 10 years ago • 0 comments

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.

zaalbarxx avatar Nov 13 '14 18:11 zaalbarxx