function QuestionHelper::mostRecentlyEnteredValue
1 call to QuestionHelper::mostRecentlyEnteredValue()
- QuestionHelper::autocomplete in vendor/
symfony/ console/ Helper/ QuestionHelper.php - Autocompletes a question.
File
-
vendor/
symfony/ console/ Helper/ QuestionHelper.php, line 380
Class
- QuestionHelper
- The QuestionHelper class provides helpers to interact with the user.
Namespace
Symfony\Component\Console\HelperCode
private function mostRecentlyEnteredValue(string $entered) : string {
// Determine the most recent value that the user entered
if (!str_contains($entered, ',')) {
return $entered;
}
$choices = explode(',', $entered);
if ('' !== ($lastChoice = trim($choices[\count($choices) - 1]))) {
return $lastChoice;
}
return $entered;
}