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 ae8e882

Browse filesBrowse files
committed
Fix phpdoc
1 parent c90152a commit ae8e882
Copy full SHA for ae8e882

File tree

6 files changed

+10
-10
lines changed
Filter options

6 files changed

+10
-10
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Command/Command.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ public function getNativeDefinition(): InputDefinition
435435
*
436436
* @param $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL
437437
* @param $default The default value (for InputArgument::OPTIONAL mode only)
438-
* @param array|\Closure(CompletionInput):array $suggestedValues The values used for input completion
438+
* @param array|\Closure(CompletionInput):list<string|Suggestion> $suggestedValues The values used for input completion
439439
*
440440
* @throws InvalidArgumentException When argument mode is not valid
441441
*
@@ -459,7 +459,7 @@ public function addArgument(string $name, int $mode = null, string $description
459459
* @param $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
460460
* @param $mode The option mode: One of the InputOption::VALUE_* constants
461461
* @param $default The default value (must be null for InputOption::VALUE_NONE)
462-
* @param array|\Closure(CompletionInput):array $suggestedValues The values used for input completion
462+
* @param array|\Closure(CompletionInput):list<string|Suggestion> $suggestedValues The values used for input completion
463463
*
464464
* @throws InvalidArgumentException If option mode is invalid or incompatible
465465
*

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Command/LazyCommand.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function getNativeDefinition(): InputDefinition
111111
/**
112112
* {@inheritdoc}
113113
*
114-
* @param array|\Closure(CompletionInput):array $suggestedValues The values used for input completion
114+
* @param array|\Closure(CompletionInput):list<string|Suggestion> $suggestedValues The values used for input completion
115115
*/
116116
public function addArgument(string $name, int $mode = null, string $description = '', mixed $default = null, /*array|\Closure $suggestedValues = []*/): static
117117
{
@@ -124,7 +124,7 @@ public function addArgument(string $name, int $mode = null, string $description
124124
/**
125125
* {@inheritdoc}
126126
*
127-
* @param array|\Closure(CompletionInput):array $suggestedValues The values used for input completion
127+
* @param array|\Closure(CompletionInput):list<string|Suggestion> $suggestedValues The values used for input completion
128128
*/
129129
public function addOption(string $name, string|array $shortcut = null, int $mode = null, string $description = '', mixed $default = null, /*array|\Closure $suggestedValues = []*/): static
130130
{

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Input/InputArgument.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class InputArgument
3939
* @param int|null $mode The argument mode: self::REQUIRED or self::OPTIONAL
4040
* @param string $description A description text
4141
* @param string|bool|int|float|array|null $default The default value (for self::OPTIONAL mode only)
42-
* @param array|\Closure(CompletionInput):array $suggestedValues The values used for input completion
42+
* @param array|\Closure(CompletionInput):list<string|Suggestion> $suggestedValues The values used for input completion
4343
*
4444
* @throws InvalidArgumentException When argument mode is not valid
4545
*/
@@ -131,7 +131,7 @@ public function complete(CompletionInput $input, CompletionSuggestions $suggesti
131131
{
132132
$values = $this->suggestedValues;
133133
if ($values instanceof \Closure && !\is_array($values = $values($input))) {
134-
throw new LogicException(sprintf('Closure for argument "%s" must return an array or null. Got "%s".', $this->name, get_debug_type($values)));
134+
throw new LogicException(sprintf('Closure for argument "%s" must return an array. Got "%s".', $this->name, get_debug_type($values)));
135135
}
136136
if ($values) {
137137
$suggestions->suggestValues($values);

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Input/InputOption.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class InputOption
6060
* @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
6161
* @param int|null $mode The option mode: One of the VALUE_* constants
6262
* @param string|bool|int|float|array|null $default The default value (must be null for self::VALUE_NONE)
63-
* @param array|\Closure(CompletionInput):array $suggestedValues The values used for input completion
63+
* @param array|\Closure(CompletionInput):list<string|Suggestion> $suggestedValues The values used for input completion
6464
*
6565
* @throws InvalidArgumentException If option mode is invalid or incompatible
6666
*/
@@ -224,7 +224,7 @@ public function complete(CompletionInput $input, CompletionSuggestions $suggesti
224224
{
225225
$values = $this->suggestedValues;
226226
if ($values instanceof \Closure && !\is_array($values = $values($input))) {
227-
throw new LogicException(sprintf('Closure for option "%s" must return an array or null. Got "%s".', $this->name, get_debug_type($values)));
227+
throw new LogicException(sprintf('Closure for option "%s" must return an array. Got "%s".', $this->name, get_debug_type($values)));
228228
}
229229
if ($values) {
230230
$suggestions->suggestValues($values);

‎src/Symfony/Component/Console/Tests/Input/InputArgumentTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Tests/Input/InputArgumentTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public function testCompleteClosure()
123123
public function testCompleteClosureReturnIncorrectType()
124124
{
125125
$this->expectException(LogicException::class);
126-
$this->expectExceptionMessage('Closure for argument "foo" must return an array or null. Got "string".');
126+
$this->expectExceptionMessage('Closure for argument "foo" must return an array. Got "string".');
127127

128128
$argument = new InputArgument('foo', InputArgument::OPTIONAL, '', null, fn (CompletionInput $input) => 'invalid');
129129
$argument->complete(new CompletionInput(), new CompletionSuggestions());

‎src/Symfony/Component/Console/Tests/Input/InputOptionTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Tests/Input/InputOptionTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ public function testCompleteClosure()
230230
public function testCompleteClosureReturnIncorrectType()
231231
{
232232
$this->expectException(LogicException::class);
233-
$this->expectExceptionMessage('Closure for option "foo" must return an array or null. Got "string".');
233+
$this->expectExceptionMessage('Closure for option "foo" must return an array. Got "string".');
234234

235235
$option = new InputOption('foo', null, InputOption::VALUE_OPTIONAL, '', null, fn (CompletionInput $input) => 'invalid');
236236
$option->complete(new CompletionInput(), new CompletionSuggestions());

0 commit comments

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