Skip to content

Commit d72782e

Browse files
committed
Minor tweaks
1 parent 9d4672a commit d72782e

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

console/input.rst

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -320,14 +320,15 @@ Using Objects as Default Values
320320

321321
.. versionadded:: 8.1
322322

323-
The support for objects as default values was introduced in Symfony 8.1.
323+
Support for objects as default values was introduced in Symfony 8.1.
324324

325325
You can use objects as default values for arguments and options in invokable
326-
commands. This is useful when you need complex default values that can be
327-
resolved at runtime::
326+
commands. This is useful when you need complex default values that are resolved
327+
at runtime::
328328

329329
use Symfony\Component\Console\Attribute\AsCommand;
330330
use Symfony\Component\Console\Attribute\Option;
331+
use Symfony\Component\Console\Command\Command;
331332
use Symfony\Component\Console\Style\SymfonyStyle;
332333

333334
#[AsCommand(name: 'app:report')]
@@ -341,7 +342,7 @@ resolved at runtime::
341342
$io->info(sprintf(
342343
'Generating report from %s to %s',
343344
$from->format('Y-m-d'),
344-
$to->format('Y-m-d')
345+
$to->format('Y-m-d'),
345346
));
346347

347348
return Command::SUCCESS;
@@ -350,10 +351,10 @@ resolved at runtime::
350351

351352
.. note::
352353

353-
Options must always have a default value when using invokable commands,
354-
so there is no way to work around this in userland. Object default values
355-
are especially useful in this context because they allow you to define
356-
complex, runtime-resolved defaults directly in the method signature.
354+
In invokable commands, options must always have a default value. Object
355+
default values are especially useful in this context because they allow
356+
you to define complex, runtime-resolved defaults directly in the method
357+
signature.
357358

358359
Using the Classic addOption() Method
359360
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)