Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 34d044c

Browse filesBrowse files
committed
bug #40427 [Console] Stop accepting ints as InputOption defaults
The types accepted and provided by `InputInterface::getOption` and `setOption` do not include `int` (and passing something like `--option=123` will set the option to the string `"123"`, not to the integer `123`). The `InputOption` default types should match this.
1 parent 756522e commit 34d044c
Copy full SHA for 34d044c

File tree

Expand file treeCollapse file tree

1 file changed

+8
-7
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-7
lines changed

‎src/Symfony/Component/Console/Input/InputOption.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Input/InputOption.php
+8-7Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,16 @@ class InputOption
2929
private $name;
3030
private $shortcut;
3131
private $mode;
32+
/** @var string|string[]|bool|null */
3233
private $default;
3334
private $description;
3435

3536
/**
36-
* @param string $name The option name
37-
* @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
38-
* @param int|null $mode The option mode: One of the VALUE_* constants
39-
* @param string $description A description text
40-
* @param string|string[]|int|bool|null $default The default value (must be null for self::VALUE_NONE)
37+
* @param string $name The option name
38+
* @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
39+
* @param int|null $mode The option mode: One of the VALUE_* constants
40+
* @param string $description A description text
41+
* @param string|string[]|bool|null $default The default value (must be null for self::VALUE_NONE)
4142
*
4243
* @throws InvalidArgumentException If option mode is invalid or incompatible
4344
*/
@@ -149,7 +150,7 @@ public function isArray()
149150
/**
150151
* Sets the default value.
151152
*
152-
* @param string|string[]|int|bool|null $default The default value
153+
* @param string|string[]|bool|null $default The default value
153154
*
154155
* @throws LogicException When incorrect default value is given
155156
*/
@@ -173,7 +174,7 @@ public function setDefault($default = null)
173174
/**
174175
* Returns the default value.
175176
*
176-
* @return string|string[]|int|bool|null The default value
177+
* @return string|string[]|bool|null The default value
177178
*/
178179
public function getDefault()
179180
{

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.