8000 refactored code · symfony/symfony@b4364aa · GitHub
[go: up one dir, main page]

Skip to content

Commit b4364aa

Browse files
committed
refactored code
1 parent b2033a1 commit b4364aa

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

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

Lines 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