Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions console/input.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,18 @@
and make the ``name`` argument required::

// ...
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Attribute\Argument;
use Symfony\Component\Console\Input\InputArgument;

class GreetCommand extends Command
#[AsCommand(name: 'app:greet')]

Check failure on line 20 in console/input.rst

View workflow job for this annotation

GitHub Actions / Lint (DOCtor-RST)

Please remove trailing whitespace
class GreetCommand
{
// ...

protected function configure(): void
public function __invoke(
#[Argument(description: 'Who do you want to greet?'] string $name,

Check failure on line 24 in console/input.rst

View workflow job for this annotation

GitHub Actions / Code Blocks

[PHP syntax] Syntax error, unexpected ']', expecting ')'
#[Argument(description: "Person's last name?"] ?string $lastName=null): void

Check failure on line 25 in console/input.rst

View workflow job for this annotation

GitHub Actions / Code Blocks

[PHP syntax] Syntax error, unexpected ']', expecting ')'
)
{
$this
// ...
->addArgument('name', InputArgument::REQUIRED, 'Who do you want to greet?')
->addArgument('last_name', InputArgument::OPTIONAL, 'Your last name?')
;
// ...
}
}

Expand Down
Loading