Skip to content
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

Avoid verbose output when we have nothing to say in ProcessFailedException #54

Merged
merged 2 commits into from
Jan 18, 2022

Conversation

weitzman
Copy link
Member

@weitzman weitzman commented Feb 2, 2021

Fixes the Process part of drush-ops/drush#4642

Overview

This pull request:

Q A
Bug fix? no
New feature? no
Has tests? no
BC breaks? no
Deprecations? no

@@ -202,6 +204,19 @@ public function start(callable $callback = null, array $env = [])
parent::start($callback, $env);
}

public function mustRun(callable $callback = null, array $env = []): \Symfony\Component\Process\Process
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to have a return typehint here? I believe the main branch is on Symfony 4, pending #50, which is what Drush is using as well, correct? And that has no return typehints?

The other issue we have is that this project is still set up to test on Travis, which is why the tests are not running. 😞

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just copied the same method from my symfony/process, which is v4.4.19 (using Drupal 9, so I can get latest code from this project). Happy to remove the type hint if desired. I'm not seeing any complaints when I do (PHP 7.3).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, now I see that you refer to the return hint. That was done by PHPStorm, but I think it is correct. The parent supermethod has self as return type hint, so this method also needs one, and self gives the following error

Fatal error: Declaration of Consolidation\SiteProcess\SiteProcess::mustRun($callback = NULL, $env = Array): Consolidation\SiteProcess\SiteProcess must be compatible with Symfony\Component\Process\Process::mustRun(?callable $callback = NULL, array $env = Array): Symfony\Component\Process\Process in /Users/moshe.weitzman/drush/vendor/consolidation/site-process/src/SiteProcess.php on line 25

Copy link
Member

@greg-1-anderson greg-1-anderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK looks good; could you rebase so that we can confirm the tests are passing?

@greg-1-anderson greg-1-anderson merged commit e9fae94 into main Jan 18, 2022
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.

2 participants