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 b4364aa

Browse filesBrowse files
committed
refactored code
1 parent b2033a1 commit b4364aa
Copy full SHA for b4364aa

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
@@ -367,19 +367,17 @@ private function autocomplete(OutputInterface $output, Question $question, $inpu
367367

368368
private function mostRecentlyEnteredValue($entered)
369369
{
370-
$tempEntered = $entered;
371-
372370
// Determine the most recent value that the user entered
373-
if (false !== strpos($entered, ',')) {
374-
$choices = explode(',', $entered);
375-
$lastChoice = trim($choices[\count($choices) - 1]);
371+
if (false === strpos($entered, ',')) {
372+
return $entered;
373+
}
376374

377-
if (\strlen($lastChoice) > 0) {
378-
$tempEntered = $lastChoice;
379-
}
375+
$choices = explode(',', $entered);
376+
if (\strlen($lastChoice = trim($choices[\count($choices) - 1])) > 0) {
377+
return $lastChoice;
380378
}
381379

382-
return $tempEntered;
380+
return $entered;
383381
}
384382

385383
/**

0 commit comments

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