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

Commit 7448d85

Browse filesBrowse files
committed
minor #29702 [Process] Fix: Method can also return null (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
2 parents 3be0445 + a7755f8 commit 7448d85
Copy full SHA for 7448d85

File tree

Expand file treeCollapse file tree

2 files changed

+16
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+16
-1
lines changed

‎src/Symfony/Component/Process/ExecutableFinder.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Process/ExecutableFinder.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function addSuffix($suffix)
4646
* @param string $default The default to return if no executable is found
4747
* @param array $extraDirs Additional dirs to check into
4848
*
49-
* @return string The executable path or default value
49+
* @return string|null The executable path or default value
5050
*/
5151
public function find($name, $default = null, array $extraDirs = array())
5252
{

‎src/Symfony/Component/Process/Tests/ExecutableFinderTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Process/Tests/ExecutableFinderTest.php
+15Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,21 @@ public function testFindWithDefault()
6565
$this->assertEquals($expected, $result);
6666
}
6767

68+
public function testFindWithNullAsDefault()
69+
{
70+
if (ini_get('open_basedir')) {
71+
$this->markTestSkipped('Cannot test when open_basedir is set');
72+
}
73+
74+
$this->setPath('');
75+
76+
$finder = new ExecutableFinder();
77+
78+
$result = $finder->find('foo');
79+
80+
$this->assertNull($result);
81+
}
82+
6883
public function testFindWithExtraDirs()
6984
{
7085
if (ini_get('open_basedir')) {

0 commit comments

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