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 95ad05f

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

File tree

7 files changed

+15
-11
lines changed
Filter options

7 files changed

+15
-11
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Command/Command.php
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\Console\Attribute\AsCommand;
1616
use Symfony\Component\Console\Completion\CompletionInput;
1717
use Symfony\Component\Console\Completion\CompletionSuggestions;
18+
use Symfony\Component\Console\Completion\Suggestion;
1819
use Symfony\Component\Console\Exception\ExceptionInterface;
1920
use Symfony\Component\Console\Exception\InvalidArgumentException;
2021
use Symfony\Component\Console\Exception\LogicException;
@@ -435,7 +436,7 @@ public function getNativeDefinition(): InputDefinition
435436
*
436437
* @param $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL
437438
* @param $default The default value (for InputArgument::OPTIONAL mode only)
438-
* @param array|\Closure(CompletionInput):array $suggestedValues The values used for input completion
439+
* @param array|\Closure(CompletionInput,CompletionSuggestions):list<string|Suggestion> $suggestedValues The values used for input completion
439440
*
440441
* @throws InvalidArgumentException When argument mode is not valid
441442
*
@@ -459,7 +460,7 @@ public function addArgument(string $name, int $mode = null, string $description
459460
* @param $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
460461
* @param $mode The option mode: One of the InputOption::VALUE_* constants
461462
* @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
463+
* @param array|\Closure(CompletionInput,CompletionSuggestions):list<string|Suggestion> $suggestedValues The values used for input completion
463464
*
464465
* @throws InvalidArgumentException If option mode is invalid or incompatible
465466
*

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Command/DumpCompletionCommand.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ protected function configure()
7575
<info>eval "$(${fullCommand} completion bash)"</>
7676
EOH
7777
)
78-
->addArgument('shell', InputArgument::OPTIONAL, 'The shell type (e.g. "bash"), the value of the "$SHELL" env var will be used if this is not given', null, fn () => $this->getSupportedShells())
78+
->addArgument('shell', InputArgument::OPTIONAL, 'The shell type (e.g. "bash"), the value of the "$SHELL" env var will be used if this is not given', null, $this->getSupportedShells(...))
7979
->addOption('debug', null, InputOption::VALUE_NONE, 'Tail the completion debug log')
8080
;
8181
}

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Command/LazyCommand.php
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Component\Console\Application;
1515
use Symfony\Component\Console\Completion\CompletionInput;
1616
use Symfony\Component\Console\Completion\CompletionSuggestions;
17+
use Symfony\Component\Console\Completion\Suggestion;
1718
use Symfony\Component\Console\Helper\HelperSet;
1819
use Symfony\Component\Console\Input\InputDefinition;
1920
use Symfony\Component\Console\Input\InputInterface;
@@ -111,7 +112,7 @@ public function getNativeDefinition(): InputDefinition
111112
/**
112113
* {@inheritdoc}
113114
*
114-
* @param array|\Closure(CompletionInput):array $suggestedValues The values used for input completion
115+
* @param array|\Closure(CompletionInput,CompletionSuggestions):list<string|Suggestion> $suggestedValues The values used for input completion
115116
*/
116117
public function addArgument(string $name, int $mode = null, string $description = '', mixed $default = null, /*array|\Closure $suggestedValues = []*/): static
117118
{
@@ -124,7 +125,7 @@ public function addArgument(string $name, int $mode = null, string $description
124125
/**
125126
* {@inheritdoc}
126127
*
127-
* @param array|\Closure(CompletionInput):array $suggestedValues The values used for input completion
128+
* @param array|\Closure(CompletionInput,CompletionSuggestions):list<string|Suggestion> $suggestedValues The values used for input completion
128129
*/
129130
public function addOption(string $name, string|array $shortcut = null, int $mode = null, string $description = '', mixed $default = null, /*array|\Closure $suggestedValues = []*/): static
130131
{

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Input/InputArgument.php
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Component\Console\Command\Command;
1515
use Symfony\Component\Console\Completion\CompletionInput;
1616
use Symfony\Component\Console\Completion\CompletionSuggestions;
17+
use Symfony\Component\Console\Completion\Suggestion;
1718
use Symfony\Component\Console\Exception\InvalidArgumentException;
1819
use Symfony\Component\Console\Exception\LogicException;
1920

@@ -39,7 +40,7 @@ class InputArgument
3940
* @param int|null $mode The argument mode: self::REQUIRED or self::OPTIONAL
4041
* @param string $description A description text
4142
* @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
43+
* @param array|\Closure(CompletionInput,CompletionSuggestions):list<string|Suggestion> $suggestedValues The values used for input completion
4344
*
4445
* @throws InvalidArgumentException When argument mode is not valid
4546
*/
@@ -131,7 +132,7 @@ public function complete(CompletionInput $input, CompletionSuggestions $suggesti
131132
{
132133
$values = $this->suggestedValues;
133134
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)));
135+
throw new LogicException(sprintf('Closure for argument "%s" must return an array. Got "%s".', $this->name, get_debug_type($values)));
135136
}
136137
if ($values) {
137138
$suggestions->suggestValues($values);

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Input/InputOption.php
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Component\Console\Command\Command;
1515
use Symfony\Component\Console\Completion\CompletionInput;
1616
use Symfony\Component\Console\Completion\CompletionSuggestions;
17+
use Symfony\Component\Console\Completion\Suggestion;
1718
use Symfony\Component\Console\Exception\InvalidArgumentException;
1819
use Symfony\Component\Console\Exception\LogicException;
1920

@@ -60,7 +61,7 @@ class InputOption
6061
* @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
6162
* @param int|null $mode The option mode: One of the VALUE_* constants
6263
* @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
64+
* @param array|\Closure(CompletionInput,CompletionSuggestions):list<string|Suggestion> $suggestedValues The values used for input completion
6465
*
6566
* @throws InvalidArgumentException If option mode is invalid or incompatible
6667
*/
@@ -224,7 +225,7 @@ public function complete(CompletionInput $input, CompletionSuggestions $suggesti
224225
{
225226
$values = $this->suggestedValues;
226227
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)));
228+
throw new LogicException(sprintf('Closure for option "%s" must return an array. Got "%s".', $this->name, get_debug_type($values)));
228229
}
229230
if ($values) {
230231
$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.