Merge branch '4.2'

* 4.2:
  refactored code
This commit is contained in:
Fabien Potencier 2019-05-08 22:08:47 +02:00
commit f646914601

View File

@ -333,19 +333,17 @@ class QuestionHelper extends Helper
private function mostRecentlyEnteredValue($entered) private function mostRecentlyEnteredValue($entered)
{ {
$tempEntered = $entered;
// Determine the most recent value that the user entered // Determine the most recent value that the user entered
if (false !== strpos($entered, ',')) { if (false === strpos($entered, ',')) {
$choices = explode(',', $entered); return $entered;
$lastChoice = trim($choices[\count($choices) - 1]);
if (\strlen($lastChoice) > 0) {
$tempEntered = $lastChoice;
}
} }
return $tempEntered; $choices = explode(',', $entered);
if (\strlen($lastChoice = trim($choices[\count($choices) - 1])) > 0) {
return $lastChoice;
}
return $entered;
} }
/** /**