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

Breadcrumb

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

function Application::getAbbreviations

Returns an array of possible abbreviations given a set of names.

Return value

string[][]

File

vendor/symfony/console/Application.php, line 829

Class

Application
An Application is the container for a collection of commands.

Namespace

Symfony\Component\Console

Code

public static function getAbbreviations(array $names) : array {
    $abbrevs = [];
    foreach ($names as $name) {
        for ($len = \strlen($name); $len > 0; --$len) {
            $abbrev = substr($name, 0, $len);
            $abbrevs[$abbrev][] = $name;
        }
    }
    return $abbrevs;
}

API Navigation

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