8000 minor #29201 Command::addOption should allow int in $default (hultberg) · symfony/symfony@c513c18 · GitHub
[go: up one dir, main page]

Skip to content

Commit c513c18

Browse files
author
Robin Chalas
committed
minor #29201 Command::addOption should allow int in $default (hultberg)
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
2 parents 144a84a + 5f8bd89 commit c513c18

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Symfony/Component/Console/Command/Command.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -381,11 +381,11 @@ public function addArgument($name, $mode = null, $description = '', $default = n
381381
/**
382382
* Adds an option.
383383
*
384-
* @param string $name The option name
385-
* @param string|array $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
386-
* @param int|null $mode The option mode: One of the VALUE_* constants
387-
* @param string $description A description text
388-
* @param string|string[]|bool|null $default The default value (must be null for self::VALUE_NONE)
384+
* @param string $name The option name
385+
* @param string|array $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
386+
* @param int|null $mode The option mode: One of the VALUE_* constants
387+
* @param string $description A description text
388+
* @param string|string[]|int|bool|null $default The default value (must be null for self::VALUE_NONE)
389389
*
390390
* @throws InvalidArgumentException If option mode is invalid or incompatible
391391
*

0 commit comments

Comments
 (0)
0