Skip to content

Commit

Permalink
minor #29815 [Console] Fix phpdoc for InputOption shortcut (tvlooy)
Browse files Browse the repository at this point in the history
This PR was submitted for the master branch but it was merged into the 3.4 branch instead (closes #29815).

Discussion
----------

[Console] Fix phpdoc for InputOption shortcut

symfony documentation tells people to pass null, and it is the default, but the method docs don't allow it so static analyzers complain about it (spotted by phan)

| Q             | A
| ------------- | ---
| Branch?       |  3.4 (careful when merging)
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

64a65e9 Fix docs
  • Loading branch information
fabpot committed Jan 9, 2019
2 parents 3245cb4 + 64a65e9 commit a5c52b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Symfony/Component/Console/Command/Command.php
Expand Up @@ -388,7 +388,7 @@ public function addArgument($name, $mode = null, $description = '', $default = n
* Adds an option.
*
* @param string $name The option name
* @param string|array $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
* @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
* @param int|null $mode The option mode: One of the InputOption::VALUE_* constants
* @param string $description A description text
* @param string|string[]|int|bool|null $default The default value (must be null for InputOption::VALUE_NONE)
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/Console/Input/InputOption.php
Expand Up @@ -34,7 +34,7 @@ class InputOption

/**
* @param string $name The option name
* @param string|array $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
* @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
* @param int|null $mode The option mode: One of the VALUE_* constants
* @param string $description A description text
* @param string|string[]|int|bool|null $default The default value (must be null for self::VALUE_NONE)
Expand Down Expand Up @@ -89,7 +89,7 @@ public function __construct($name, $shortcut = null, $mode = null, $description
/**
* Returns the option shortcut.
*
* @return string The shortcut
* @return string|null The shortcut
*/
public function getShortcut()
{
Expand Down

0 comments on commit a5c52b8

Please sign in to comment.