Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/console/Descriptor/ApplicationDescription.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 1fec387a4317 |
children |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
95 return isset($this->commands[$name]) ? $this->commands[$name] : $this->aliases[$name]; | 95 return isset($this->commands[$name]) ? $this->commands[$name] : $this->aliases[$name]; |
96 } | 96 } |
97 | 97 |
98 private function inspectApplication() | 98 private function inspectApplication() |
99 { | 99 { |
100 $this->commands = array(); | 100 $this->commands = []; |
101 $this->namespaces = array(); | 101 $this->namespaces = []; |
102 | 102 |
103 $all = $this->application->all($this->namespace ? $this->application->findNamespace($this->namespace) : null); | 103 $all = $this->application->all($this->namespace ? $this->application->findNamespace($this->namespace) : null); |
104 foreach ($this->sortCommands($all) as $namespace => $commands) { | 104 foreach ($this->sortCommands($all) as $namespace => $commands) { |
105 $names = array(); | 105 $names = []; |
106 | 106 |
107 /** @var Command $command */ | 107 /** @var Command $command */ |
108 foreach ($commands as $name => $command) { | 108 foreach ($commands as $name => $command) { |
109 if (!$command->getName() || (!$this->showHidden && $command->isHidden())) { | 109 if (!$command->getName() || (!$this->showHidden && $command->isHidden())) { |
110 continue; | 110 continue; |
117 } | 117 } |
118 | 118 |
119 $names[] = $name; | 119 $names[] = $name; |
120 } | 120 } |
121 | 121 |
122 $this->namespaces[$namespace] = array('id' => $namespace, 'commands' => $names); | 122 $this->namespaces[$namespace] = ['id' => $namespace, 'commands' => $names]; |
123 } | 123 } |
124 } | 124 } |
125 | 125 |
126 /** | 126 /** |
127 * @return array | 127 * @return array |
128 */ | 128 */ |
129 private function sortCommands(array $commands) | 129 private function sortCommands(array $commands) |
130 { | 130 { |
131 $namespacedCommands = array(); | 131 $namespacedCommands = []; |
132 $globalCommands = array(); | 132 $globalCommands = []; |
133 foreach ($commands as $name => $command) { | 133 foreach ($commands as $name => $command) { |
134 $key = $this->application->extractNamespace($name, 1); | 134 $key = $this->application->extractNamespace($name, 1); |
135 if (!$key) { | 135 if (!$key) { |
136 $globalCommands['_global'][$name] = $command; | 136 $globalCommands['_global'][$name] = $command; |
137 } else { | 137 } else { |