Skip to content

Commit 64df53f

Browse files
committed
Merge branch '4.2'
* 4.2: refactored code
2 parents b15836b + 28e7360 commit 64df53f

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

Helper/QuestionHelper.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -333,19 +333,17 @@ function ($match) use ($ret) {
333333

334334
private function mostRecentlyEnteredValue($entered)
335335
{
336-
$tempEntered = $entered;
337-
338336
// Determine the most recent value that the user entered
339-
if (false !== strpos($entered, ',')) {
340-
$choices = explode(',', $entered);
341-
$lastChoice = trim($choices[\count($choices) - 1]);
337+
if (false === strpos($entered, ',')) {
338+
return $entered;
339+
}
342340

343-
if (\strlen($lastChoice) > 0) {
344-
$tempEntered = $lastChoice;
345-
}
341+
$choices = explode(',', $entered);
342+
if (\strlen($lastChoice = trim($choices[\count($choices) - 1])) > 0) {
343+
return $lastChoice;
346344
}
347345

348-
return $tempEntered;
346+
return $entered;
349347
}
350348

351349
/**

0 commit comments

Comments
 (0)