-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Bus::dispatchChain
#19
Conversation
|
||
return $this->areClassesSame($variableClass, $subjectClass); | ||
return count($variableClasses) === 1 && $this->areClassesSame($variableClasses[0], $subjectClass); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JonasPardon this is for backwards-compatibility, but you may have more context around the use cases here.
@@ -100,16 +107,21 @@ public function getMethodCalls( | |||
throw new Exception('Static calls within method calls are not supported yet. If this is a Bus::chain, support is coming.'); | |||
} | |||
|
|||
throw new Exception('Not supported yet. Please open an issue here: https://github.com/JonasPardon/laravel-event-visualizer/issues/new'); | |||
// throw new Exception('Not supported yet. Please open an issue here: https://github.com/JonasPardon/laravel-event-visualizer/issues/new'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JonasPardon disabled this to avoid breaking this loop.
method: $node->name->toString(), | ||
); | ||
})->toArray(); | ||
return collect($this->resolveClassesFromArgument($node->args[0])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JonasPardon there may be a cleaner way to do this.
Hi @joelvh, this all looks good to me. Thanks for the contribution! |
This adds support for
Bus::dispatchChain
. This change introduces the idea that multiple classes can be resolved rather than a single class.Tests are added for an array of jobs as an argument or assigned to a variable.
I've also removed the exception when an unsupported dispatch call is encountered in order to avoid exiting early.
See #8 for some discussion about this.