You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently it is no easy way to customize the execution loop listeners.
I managed to do that by extending Psy\Shell and overriding getDefaultLoopListeners() method:
but that doesn't seem like a clean solution. I think we should enable users to customize them via constructor or addLoopListener()/setLoopListeners() methods following addMatchers() and addTabCompletionMatchers() methods convention so the code would become:
I was trying to log every beforeRun, onExecute and afterRun event. I ended up creating a class inheriting the Shell and overriding these methods to add such behavior but it is not that flexible (composition over inheritance).
Right, but why? I still don’t understand your use case. I’m not opposed to opening up more extension points, but there is a maintenance and support cost associated, and this one hasn’t happened because I haven’t seen a good reason for it yet.
As a ___________ I want to ___________ so that ___________
Currently it is no easy way to customize the execution loop listeners.
I managed to do that by extending
Psy\Shell
and overridinggetDefaultLoopListeners()
method:but that doesn't seem like a clean solution. I think we should enable users to customize them via constructor or
addLoopListener()
/setLoopListeners()
methods followingaddMatchers()
andaddTabCompletionMatchers()
methods convention so the code would become:@bobthecow WDYT?
The text was updated successfully, but these errors were encountered: