laracasts / Commander

Easily leverage commands and domain events in your Laravel projects.
https://laracasts.com/series/commands-and-domain-events
MIT License
279 stars 68 forks source link

Switch to bind to prevent decorator sharing #52

Closed yateric closed 9 years ago

yateric commented 9 years ago

Sometimes you may need to execute multiple commands at the same time, it will accidentally share same decorators which is not intended that they should be, because the decorators array is store in the shared command bus.

e.g. $this->execute(PostJobListingCommand::class, $data, JobSanitizer); $this->execute(ClearCacheCommand::class);

The second execute will take the JobSanitizer docorator which is not intended.

jojovem commented 9 years ago

+1