Skip to content

Commit f12231b

Browse files
committed
[Console] Rename #[Input] to #[MapInput]
1 parent 172e24c commit f12231b

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/Symfony/Component/Console/Attribute/Input.php renamed to src/Symfony/Component/Console/Attribute/MapInput.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use Symfony\Component\Console\Input\InputInterface;
1717

1818
#[\Attribute(\Attribute::TARGET_PARAMETER | \Attribute::TARGET_PROPERTY)]
19-
final class Input
19+
final class MapInput
2020
{
2121
/**
2222
* @var array<string, Argument|Option|self>

src/Symfony/Component/Console/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ CHANGELOG
1111
* Add `BackedEnum` support with `#[Argument]` and `#[Option]` inputs in invokable commands
1212
* Allow Usages to be specified via `#[AsCommand]` attribute.
1313
* Allow passing invokable commands to `Symfony\Component\Console\Tester\CommandTester`
14-
* Add `#[Input]` attribute to support DTOs in commands
14+
* Add `#[MapInput]` attribute to support DTOs in commands
1515
* Add optional timeout for interaction in `QuestionHelper`
1616

1717
7.3

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use Symfony\Component\Console\Application;
1515
use Symfony\Component\Console\Attribute\Argument;
16-
use Symfony\Component\Console\Attribute\Input;
16+
use Symfony\Component\Console\Attribute\MapInput;
1717
use Symfony\Component\Console\Attribute\Option;
1818
use Symfony\Component\Console\Exception\LogicException;
1919
use Symfony\Component\Console\Exception\RuntimeException;
@@ -87,7 +87,7 @@ public function configure(InputDefinition $definition): void
8787
continue;
8888
}
8989

90-
if ($input = Input::tryFrom($parameter)) {
90+
if ($input = MapInput::tryFrom($parameter)) {
9191
$inputArguments = array_map(fn (Argument $a) => $a->toInputArgument(), iterator_to_array($input->getArguments(), false));
9292

9393
// make sure optional arguments are defined after required ones
@@ -149,7 +149,7 @@ private function getParameters(InputInterface $input, OutputInterface $output):
149149
continue;
150150
}
151151

152-
if ($in = Input::tryFrom($parameter)) {
152+
if ($in = MapInput::tryFrom($parameter)) {
153153
$parameters[] = $in->resolveValue($input);
154154

155155
continue;

src/Symfony/Component/Console/Tests/Fixtures/InvokableWithInputTestCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313

1414
use Symfony\Component\Console\Attribute\Argument;
1515
use Symfony\Component\Console\Attribute\AsCommand;
16-
use Symfony\Component\Console\Attribute\Input;
16+
use Symfony\Component\Console\Attribute\MapInput;
1717
use Symfony\Component\Console\Attribute\Option;
1818
use Symfony\Component\Console\Command\Command;
1919
use Symfony\Component\Console\Style\SymfonyStyle;
2020

2121
#[AsCommand('invokable:input:test')]
2222
class InvokableWithInputTestCommand
2323
{
24-
public function __invoke(SymfonyStyle $io, #[Input] UserDto $user): int
24+
public function __invoke(SymfonyStyle $io, #[MapInput] UserDto $user): int
2525
{
2626
$io->writeln($user->name);
2727
$io->writeln($user->email);
@@ -47,7 +47,7 @@ final class UserDto
4747
#[Argument]
4848
public string $password;
4949

50-
#[Input]
50+
#[MapInput]
5151
public UserGroupDto $group;
5252

5353
#[Option]

0 commit comments

Comments
 (0)