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

Breadcrumb

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

function Application::extractAllNamespaces

Returns all namespaces of the command name.

Return value

string[]

1 call to Application::extractAllNamespaces()
Application::getNamespaces in vendor/symfony/console/Application.php
Returns an array of all unique namespaces used by currently registered commands.

File

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

Class

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

Namespace

Symfony\Component\Console

Code

private function extractAllNamespaces(string $name) : array {
    // -1 as third argument is needed to skip the command short name when exploding
    $parts = explode(':', $name, -1);
    $namespaces = [];
    foreach ($parts as $part) {
        if (\count($namespaces)) {
            $namespaces[] = end($namespaces) . ':' . $part;
        }
        else {
            $namespaces[] = $part;
        }
    }
    return $namespaces;
}

API Navigation

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