Skip to content

[13.x] Fix quietly() making throw() unreachable on process results - #61227

Open
xurshudyan wants to merge 2 commits into
laravel:13.xfrom
xurshudyan:fix-quietly-process-output-disabled
Open

[13.x] Fix quietly() making throw() unreachable on process results#61227
xurshudyan wants to merge 2 commits into
laravel:13.xfrom
xurshudyan:fix-quietly-process-output-disabled

Conversation

@xurshudyan

Copy link
Copy Markdown
Contributor

Combining quietly() with throw() never produces a ProcessFailedException,
so the catch block below is dead code:

try {
    Process::quietly()->run('composer install')->throw();
} catch (ProcessFailedException $e) {
    $this->error("Install failed with code {$e->getCode()}");
}
PHP Fatal error: Uncaught Symfony\Component\Process\Exception\LogicException:
Output has been disabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant