Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Console run commands when they are SignalableCommandInterface and don´t have signalsToDispatchEvent #42076

Copy link
Copy link
Closed
@PaolaRuby

Description

@PaolaRuby
Issue body actions

Description
When a command extends a class wich implements SignalableCommandInterface but the command has empty signals to dispatch, it still can be executed, It can be useful when the extension is not available and the command is necessary.
Also, it can be used like a workaround for support other environments, for example windows servers, they don't have pcntl extension

Example
If change this

if ($command instanceof SignalableCommandInterface) {
if (!$this->signalRegistry) {
throw new RuntimeException('Unable to subscribe to signal events. Make sure that the `pcntl` extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.');
}
if ($this->dispatcher) {
foreach ($this->signalsToDispatchEvent as $signal) {

for this

if ($command instanceof SignalableCommandInterface) {
    if (!$this->signalRegistry && !(empty($this->signalsToDispatchEvent) && empty($command->getSubscribedSignals()))) {
        throw new RuntimeException('Unable to subscribe to signal events. Make sure that the `pcntl` extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.');
    }

Now when signalsToDispatchEvent has signals still throws RuntimeException, but when it don't has, it continues, maybe i can make a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.