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 fbaf220

Browse filesBrowse files
author
Robin Chalas
committed
minor #28647 [Console] Add missing null to input values allowed types (chalasr)
This PR was merged into the 2.8 branch. Discussion ---------- [Console] Add missing null to input values allowed types | Q | A | ------------- | --- | Branch? | 4.1 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a When switching from `mixed` in #28448 we forgot that input arguments/options are default `null` and can be set to null (e.g. when passed empty with mode `VALUE_OPTIONAL`). Spotted by @ro0NL Commits ------- f0bc2a6 [Console] Add missing null to input values allowed types
2 parents d1db71a + f0bc2a6 commit fbaf220
Copy full SHA for fbaf220

File tree

Expand file treeCollapse file tree

3 files changed

+19
-19
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+19
-19
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Input/InputArgument.php
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ class InputArgument
3131
private $description;
3232

3333
/**
34-
* @param string $name The argument name
35-
* @param int $mode The argument mode: self::REQUIRED or self::OPTIONAL
36-
* @param string $description A description text
37-
* @param mixed $default The default value (for self::OPTIONAL mode only)
34+
* @param string $name The argument name
35+
* @param int|null $mode The argument mode: self::REQUIRED or self::OPTIONAL
36+
* @param string $description A description text
37+
* @param string|string[]|null $default The default value (for self::OPTIONAL mode only)
3838
*
3939
* @throws InvalidArgumentException When argument mode is not valid
4040
*/
@@ -86,7 +86,7 @@ public function isArray()
8686
/**
8787
* Sets the default value.
8888
*
89-
* @param string|string[] $default The default value
89+
* @param string|string[]|null $default The default value
9090
*
9191
* @throws LogicException When incorrect default value is given
9292
*/
@@ -110,7 +110,7 @@ public function setDefault($default = null)
110110
/**
111111
* Returns the default value.
112112
*
113-
* @return string|string[] The default value
113+
* @return string|string[]|null The default value
114114
*/
115115
public function getDefault()
116116
{

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Input/InputInterface.php
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function getArguments();
8383
*
8484
* @param string $name The argument name
8585
*
86-
* @return string|string[] The argument value
86+
* @return string|string[]|null The argument value
8787
*
8888
* @throws InvalidArgumentException When argument given doesn't exist
8989
*/
@@ -92,8 +92,8 @@ public function getArgument($name);
9292
/**
9393
* Sets an argument value by name.
9494
*
95-
* @param string $name The argument name
96-
* @param string|string[] $value The argument value
95+
* @param string $name The argument name
96+
* @param string|string[]|null $value The argument value
9797
*
9898
* @throws InvalidArgumentException When argument given doesn't exist
9999
*/
@@ -120,7 +120,7 @@ public function getOptions();
120120
*
121121
* @param string $name The option name
122122
*
123-
* @return string|string[]|bool The option value
123+
* @return string|string[]|bool|null The option value
124124
*
125125
* @throws InvalidArgumentException When option given doesn't exist
126126
*/
@@ -129,8 +129,8 @@ public function getOption($name);
129129
/**
130130
* Sets an option value by name.
131131
*
132-
* @param string $name The option name
133-
* @param string|string[]|bool $value The option value
132+
* @param string $name The option name
133+
* @param string|string[]|bool|null $value The option value
134134
*
135135
* @throws InvalidArgumentException When option given doesn't exist
136136
*/

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Input/InputOption.php
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ class InputOption
3333
private $description;
3434

3535
/**
36-
* @param string $name The option name
37-
* @param string|array $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
38-
* @param int $mode The option mode: One of the VALUE_* constants
39-
* @param string $description A description text
40-
* @param mixed $default The default value (must be null for self::VALUE_NONE)
36+
* @param string $name The option name
37+
* @param string|array $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[]|bool|null $default The default value (must be null for self::VALUE_NONE)
4141
*
4242
* @throws InvalidArgumentException If option mode is invalid or incompatible
4343
*/
@@ -149,7 +149,7 @@ public function isArray()
149149
/**
150150
* Sets the default value.
151151
*
152-
* @param string|string[]|bool $default The default value
152+
* @param string|string[]|bool|null $default The default value
153153
*
154154
* @throws LogicException When incorrect default value is given
155155
*/
@@ -173,7 +173,7 @@ public function setDefault($default = null)
173173
/**
174174
* Returns the default value.
175175
*
176-
* @return string|string[]|bool The default value
176+
* @return string|string[]|bool|null The default value
177177
*/
178178
public function getDefault()
179179
{

0 commit comments

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