-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Process] Fix: Method can also return null #29702
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
Conversation
Thank you @localheinz. |
This PR was merged into the 3.4 branch. Discussion ---------- [Process] Fix: Method can also return null | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a This PR * [x] adjusts a DocBlock and also provides a corresponding test that asserts that `ExecutableFinder::find()` may return `null` Commits ------- a7755f8 Fix: Method can also return null
Thank you, @fabpot! |
@@ -46,7 +46,7 @@ public function addSuffix($suffix) | ||
* @param string $default The default to return if no executable is found | ||
* @param array $extraDirs Additional dirs to check into | ||
* | ||
* @return string The executable path or default value | ||
* @return string|null The executable path or default value |
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.
If I don't miss anything, this can only happen when $default
is returned. We may have wanted to fix the param for this argument too then. ;)
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.
Do you mean
diff --git a/src/Symfony/Component/Process/ExecutableFinder.php b/src/Symfony/Component/Process/ExecutableFinder.php
index ad2c76ab60..90cafa34e3 100644
--- a/src/Symfony/Component/Process/ExecutableFinder.php
+++ b/src/Symfony/Component/Process/ExecutableFinder.php
@@ -42,9 +42,9 @@ class ExecutableFinder
/**
* Finds an executable by name.
*
- * @param string $name The executable name (without the extension)
- * @param string $default The default to return if no executable is found
- * @param array $extraDirs Additional dirs to check into
+ * @param string $name The executable name (without the extension)
+ * @param string|null $default The default to return if no executable is found
+ * @param array $extraDirs Additional dirs to check into
*
* @return string|null The executable path or default value
*/
?
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.
Yes
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.
Adjusted with #29752!
This PR was merged into the 3.4 branch. Discussion ---------- [Process] Fix: Adjust DocBlock | Q | A | ------------- | --- | Branch? | `3.4` | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a This PR * [x] adjusts a DocBlock Follows #29702 (comment). Commits ------- f8be46b Fix: Adjust DocBlock
This PR
ExecutableFinder::find()
may returnnull