Skip to content

[Console] rename Command::private to Command::hidden #20266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/Symfony/Component/Console/Command/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Command
private $processTitle;
private $aliases = array();
private $definition;
private $public = true;
private $hidden = false;
private $help;
private $description;
private $ignoreValidationErrors = false;
Expand Down Expand Up @@ -448,23 +448,23 @@ public function getName()
}

/**
* @param bool $public Whether the command should be publicly shown or not.
* @param bool $hidden Whether or not the command should be hidden from the list of commands
*
* @return Command The current instance
*/
public function setPublic($public)
public function setHidden($hidden)
{
$this->public = (bool) $public;
$this->hidden = (bool) $hidden;

return $this;
}

/**
* @return bool Whether the command should be publicly shown or not.
*/
public function isPublic()
public function isHidden()
{
return $this->public;
return $this->hidden;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ private function inspectApplication()

/** @var Command $command */
foreach ($commands as $name => $command) {
if (!$command->getName() || !$command->isPublic()) {
if (!$command->getName() || $command->isHidden()) {
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ protected function configure()
->setName('descriptor:command3')
->setDescription('command 3 description')
->setHelp('command 3 help')
->setPublic(false)
->setHidden(true)
;
}
}