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

Axing persistent decorators #27

Open aarongustafson opened 10 years ago

aarongustafson commented 10 years ago

This pull request fixes #22.

JeffreyWay commented 10 years ago

Hmm - I'm not sure I like the idea of 'undecorate'. I'll see if I can make it reset every time.

aarongustafson commented 10 years ago

Yeah, I had a hard time coming up with a name :-)

Hmm - I'm not sure I like the idea of 'undecorate'. I'll see if I can make it reset every time.

— Reply to this email directly or view it on GitHub (https://github.com/laracasts/Commander/pull/27#issuecomment-52336429).

dimamarkus commented 9 years ago

Hey Jeff,

Do you have any tips on how to run multiple commands with their own decorators in one controller action? It does not seem to be possible. The second command hits the decorators of the first. Please let us know or consider this pull request please.

MitchellMcKenna commented 9 years ago

@JeffreyWay Would you be okay with clearDecorators() instead of undecorate()?

@aarongustafson Can you update the pull request to fix the merge conflicts (looks like just a comment has changed)? Also, you don't have to do if (count($decorators)) you can just do if ($decorators).

ronnievisser commented 9 years ago

I really need this fix? when will it be merged?

ronnievisser commented 9 years ago

Related to this issue I found another but. when for example foreaching a collection en in that foreach you have a command executed with a decorated the command itself get's multiplied. so first 1 command, second 2 commands, third item 3 commands, etc etc..

jojovem commented 9 years ago

+1. I just go into the same problem, will this be fixed?

aarongustafson commented 9 years ago

I tweaked the method name and the conditional.