Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. QuestionHelper.php

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\Helper

Code

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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal