-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Fix phpdocs #28714
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
Fix phpdocs #28714
Conversation
* @param string $name The argument name | ||
* @param int|null $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL | ||
* @param string $description A description text | ||
* @param mixed $default The default value (for InputArgument::OPTIONAL mode only) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Params should be the same as InputArgument::__construct()
which has been corrected recently
symfony/src/Symfony/Component/Console/Input/InputArgument.php
Lines 34 to 37 in 196086c
* @param string $name The argument name | |
* @param int|null $mode The argument mode: self::REQUIRED or self::OPTIONAL | |
* @param string $description A description text | |
* @param string|string[]|null $default The default value (for self::OPTIONAL mode only) |
* @param int $mode The option mode: One of the InputOption::VALUE_* constants | ||
* @param string $description A description text | ||
* @param mixed $default The default value (must be null for InputOption::VALUE_NONE) | ||
* @param string $name The option name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same but for InputOption
symfony/src/Symfony/Component/Console/Input/InputOption.php
Lines 36 to 40 in 196086c
* @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 int|null $mode The option mode: One of the VALUE_* constants | |
* @param string $description A description text | |
* @param string|string[]|bool|null $default The default value (must be null for self::VALUE_NONE) |
@chalasr Fixed it. Docs are now equal to the docs from the object constructors (InputArgument/InputOption) |
For 2.8 |
See phan/phan#2025 for explaination
Thank you @mschop. |
This PR was submitted for the master branch but it was merged into the 2.8 branch instead (closes #28714). Discussion ---------- Fix phpdocs | Q | A | ------------- | --- | Branch? | all supported releases and master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes (I didn't run them, but just changed docs) | Fixed tickets | None | License | MIT See phan/phan#2025 for details. Fix phpdocs for Command for preventing static code analysis tools to emit false positives. Commits ------- 7196e49 Fix phpdocs
This PR was merged into the 2.8 branch. Discussion ---------- Command::addOption should allow int in $default | Q | A | ------------- | --- | Branch? | all | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | none | License | MIT | Doc PR | <!-- Write a short README entry for your feature/bugfix here (replace this comment block.) This will help people understand your PR and can be used as a start of the Doc PR. Additionally: - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. --> In #28714 the documentation for `$default` on `Command::addOption` was changed to specify more specifically than `mixed`. However, there is an inconsistency as `InputOption::__construct` allows int in its `$default`, but not `Command::addOption`. This PR makes fixes that inconsistency. Commits ------- 5f8bd89 Command::addOption should allow int in $default
Issue was introduced symfony#28714
This PR was merged into the 3.4 branch. Discussion ---------- [Console] fix PHPDoc in Command | Q | A | ------------- | --- | Branch? | 3.4 up to 4.2 for bug fixes <!-- see below --> | Bug fix? | yes | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | License | MIT <!-- Write a short README entry for your feature/bugfix here (replace this comment block.) This will help people understand your PR and can be used as a start of the Doc PR. Additionally: - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. --> Issue was introduced in #28714, this PR fixes copy&paste from `InputArgument` and `InputOption`. Commits ------- 13bcd6a [Console] fix PHPDoc in Command
See phan/phan#2025 for details.
Fix phpdocs for Command for preventing static code analysis tools to emit false positives.