Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
feature #35402 [Console] Set Command::setHidden() final for adding de…
…fault param in SF 6.0 (lyrixx)

This PR was merged into the 5.1-dev branch.

Discussion
----------

[Console] Set Command::setHidden() final for adding default param in SF 6.0

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Commits
-------

e2ede07 [Console] Add default parameter (true) for Command::setHidden()
  • Loading branch information
nicolas-grekas committed Jan 27, 2020
2 parents af295b5 + e2ede07 commit 5182135
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions UPGRADE-5.1.md
@@ -1,6 +1,11 @@
UPGRADE FROM 5.0 to 5.1
=======================

Console
-------

* `Command::setHidden()` is final since Symfony 5.1

EventDispatcher
---------------

Expand Down
5 changes: 5 additions & 0 deletions UPGRADE-6.0.md
@@ -1,6 +1,11 @@
UPGRADE FROM 5.x to 6.0
=======================

Console
-------

* `Command::setHidden()` has a default value (`true`) for `$hidden` parameter

EventDispatcher
---------------

Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Component/Console/CHANGELOG.md
Expand Up @@ -4,6 +4,7 @@ CHANGELOG
5.1.0
-----

* `Command::setHidden()` is final since Symfony 5.1
* Add `SingleCommandApplication`

5.0.0
Expand Down
5 changes: 4 additions & 1 deletion src/Symfony/Component/Console/Command/Command.php
Expand Up @@ -450,10 +450,13 @@ public function getName()

/**
* @param bool $hidden Whether or not the command should be hidden from the list of commands
* The default value will be true in Symfony 6.0
*
* @return Command The current instance
*
* @final since Symfony 5.1
*/
public function setHidden(bool $hidden)
public function setHidden(bool $hidden /*= true*/)
{
$this->hidden = $hidden;

Expand Down

0 comments on commit 5182135

Please sign in to comment.