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 3fc97ce

Browse filesBrowse files
committed
Merge branch '3.4' into 4.2
* 3.4: refactored code
2 parents a3c3c44 + b4364aa commit 3fc97ce
Copy full SHA for 3fc97ce

File tree

1 file changed

+7
-9
lines changed
Filter options

1 file changed

+7
-9
lines changed

‎src/Symfony/Component/Console/Helper/QuestionHelper.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Helper/QuestionHelper.php
+7-9Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -328,19 +328,17 @@ private function autocomplete(OutputInterface $output, Question $question, $inpu
328328

329329
private function mostRecentlyEnteredValue($entered)
330330
{
331-
$tempEntered = $entered;
332-
333331
// Determine the most recent value that the user entered
334-
if (false !== strpos($entered, ',')) {
335-
$choices = explode(',', $entered);
336-
$lastChoice = trim($choices[\count($choices) - 1]);
332+
if (false === strpos($entered, ',')) {
333+
return $entered;
334+
}
337335

338-
if (\strlen($lastChoice) > 0) {
339-
$tempEntered = $lastChoice;
340-
}
336+
$choices = explode(',', $entered);
337+
if (\strlen($lastChoice = trim($choices[\count($choices) - 1])) > 0) {
338+
return $lastChoice;
341339
}
342340

343-
return $tempEntered;
341+
return $entered;
344342
}
345343

346344
/**

0 commit comments

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