extractNamespace() public method

This method is not part of public API and should not be used directly.
public extractNamespace ( string $name, string $limit = null ) : string
$name string The full name of the command
$limit string The maximum number of parts of the namespace
return string The namespace of the command
 /**
  * @param array $commands
  *
  * @return array
  */
 private function sortCommands(array $commands)
 {
     $namespacedCommands = array();
     foreach ($commands as $name => $command) {
         $key = $this->application->extractNamespace($name, 1);
         if (!$key) {
             $key = '_global';
         }
         $namespacedCommands[$key][$name] = $command;
     }
     ksort($namespacedCommands);
     foreach ($namespacedCommands as &$commands) {
         ksort($commands);
     }
     return $namespacedCommands;
 }
 /**
  *
  * @param array $commands        	
  *
  * @return array
  */
 private function sortCommands(array $commands)
 {
     $namespacedCommands = array();
     foreach ($commands as $name => $command) {
         $key = $this->application->extractNamespace($name, 1);
         if (!$key) {
             $key = '_global';
         }
         $namespacedCommands[$key][$name] = $command;
     }
     ksort($namespacedCommands);
     foreach ($namespacedCommands as &$commandsSet) {
         ksort($commandsSet);
     }
     // unset reference to keep scope clear
     unset($commandsSet);
     return $namespacedCommands;
 }