You are here

private function Application::extractAllNamespaces in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/console/Application.php \Symfony\Component\Console\Application::extractAllNamespaces()

Returns all namespaces of the command name.

Parameters

string $name The full name of the command:

Return value

array The namespaces of the command

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 1123

Class

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

Namespace

Symfony\Component\Console

Code

private function extractAllNamespaces($name) {

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