Skip to content

Commit 8096606

Browse files
authored
Use new native isHidden() method in Help. Also mark SUT commands as hidden. (#3698)
1 parent d39847d commit 8096606

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

src/Commands/help/ListCommands.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,7 @@ public function renderListRaw($namespaced)
199199
public static function categorize($all, $separator = ':')
200200
{
201201
foreach ($all as $key => $command) {
202-
$hidden = method_exists($command, 'getAnnotationData') && $command->getAnnotationData()->has('hidden');
203-
if (!in_array($key, $command->getAliases()) && !$hidden) {
202+
if (!in_array($key, $command->getAliases()) && !$command->isHidden()) {
204203
$parts = explode($separator, $key);
205204
$namespace = count($parts) >= 2 ? array_shift($parts) : '_global';
206205
$namespaced[$namespace][$key] = $command;

sut/drush/Commands/SimpleSutCommands.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class SimpleSutCommands extends DrushCommands
2424
* Show a fabulous picture.
2525
*
2626
* @command sut:simple
27+
* @hidden
2728
*/
2829
public function example()
2930
{

sut/drush/Commands/custom/example-site-wide-command/NestedSutCommands.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class NestedSutCommands extends DrushCommands
2424
* Show a fabulous picture.
2525
*
2626
* @command sut:nested
27+
* @hidden
2728
*/
2829
public function example()
2930
{

sut/drush/Commands/custom/example-site-wide-command/src/NestedSrcSutCommands.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class NestedSrcSutCommands extends DrushCommands
2424
* Show a fabulous picture.
2525
*
2626
* @command sut:nested-src
27+
* @hidden
2728
*/
2829
public function example()
2930
{

0 commit comments

Comments
 (0)