Refactor the whole package to use events #39
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Because of consolidation/annotated-command#273, which technically speaking contains a BC break, it was made clear for us that we're not using Robo or the consolidation packages as they were intended. In an effort to keep this package as extendible as possible, and keeping the same philosophy as before, we switched to an event-based system. Basically every step in a command fires an event. The event listener returns a
HandlerWithPriority
, which it turn returns aTaskInterface
to be executed for this step in the command. We made our own implementation of event priorities, since the default implementation used in Robo doesn't support them(consolidation/annotated-command#244).
I tried to document everything as well as possible in the README, but it might (probably will) need some lovin'.
This package contains default event handlers with some sensible (to us) defaults. You can prevent these handlers from being executed by writig your own handler with a higher priority (lower number) which does its thing and then calls
$event->stopPropagation()
.