Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Console] Fix ConsoleEvents::SIGNAL subscriber dispatch#45333
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
GwendolenLynch commentedFeb 7, 2022
| Q | A |
|---|---|
| Branch? | 5.4 |
| Bug fix? | yes |
| New feature? | no |
| Deprecations? | no |
| Tickets | Fix#45332 |
| License | MIT |
derrabus commentedFeb 9, 2022
Thank you for your PR! Can you please add a test hat covers your change? |
f8385fd toe44ae6eCompareGwendolenLynch commentedFeb 9, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Added@derrabus. The act of writing the tests showed up some missing bits, so thank you for the nudge. Changed
Please let me know what changes you'd like made. |
44c9186 to0b7cd1dCompareUh oh!
There was an error while loading.Please reload this page.
0b7cd1d to4068bc9CompareUh oh!
There was an error while loading.Please reload this page.
lyrixx left a comment
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.
All good 👍🏼
Uh oh!
There was an error while loading.Please reload this page.
nicolas-grekas commentedAug 2, 2022
Thank you@GwendolenLynch. |
4068bc9 to2b46650Compare| } | ||
| if ($this->signalsToDispatchEvent) { | ||
| $commandSignals =$commandinstanceof SignalableCommandInterface ?$command->getSubscribedSignals() : []; | ||
| $dispatchSignals =$this->dispatcher &&$this->dispatcher->hasListeners(ConsoleEvents::SIGNAL); |
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.
$this->dispatcher is typed to be a\Symfony\Contracts\EventDispatcher\EventDispatcherInterface, buthasListeners is not part of that contract.
This leads to our package breaking with the current branch version (5.4.x-dev in our case), since it does not fulfill the\Symfony\Component\EventDispatcher\EventDispatcherInterface
helhum commentedAug 5, 2022
@GwendolenLynch@nicolas-grekas I added a comment regarding using |
nicolas-grekas commentedAug 5, 2022
This should be fixed. Up for a PR? |
…y with the contract interface (xabbuh)This PR was merged into the 5.4 branch.Discussion----------[Console] fix dispatch signal event check for compatibility with the contract interface| Q | A| ------------- | ---| Branch? | 5.4| Bug fix? | yes| New feature? | no| Deprecations? | no| Tickets |Fix#45333 (comment)| License | MIT| Doc PR |Commits-------6b29591 fix dispatch signal event check for compatibility with the contract interface
| } | ||
| } | ||
| foreach ($commandSignalsas$signal) { |
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.
Is there any specific reason why the order of registration of signal handlers have been modified? This caused an issue#48205 (comment)
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.
I can't remember my approach/reason at the time, but the test added in this PR should cover the use-case problem I had.
Your fix#48210 is most probably correct.
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.
Thanks you for reviewing.