@@ -473,19 +473,10 @@ The attribute takes more parameters to customize the trigger::
473
473
// defines the timezone to use
474
474
#[AsCronTask('0 0 * * *', timezone: 'Africa/Malabo')]
475
475
476
- Arguments/options for Symfony commands are passed as plain string::
477
-
478
- use Symfony\Component\Console\Command\Command;
479
-
480
- #[AsCronTask('0 0 * * *', arguments: 'arg --my-option')]
476
+ // when applying this attribute to a Symfony console command, you can pass
477
+ // arguments and options to the command using the 'arguments' option:
478
+ #[AsCronTask('0 0 * * *', arguments: 'some_argument --some-option --another-option=some_value')]
481
479
class MyCommand extends Command
482
- {
483
- protected function configure(): void
484
- {
485
- $this->addArgument('my-arg');
486
- $this->addOption('my-option');
487
- }
488
- }
489
480
490
481
.. versionadded :: 6.4
491
482
@@ -536,19 +527,10 @@ The ``#[AsPeriodicTask]`` attribute takes many parameters to customize the trigg
536
527
}
537
528
}
538
529
539
- Arguments/options for Symfony commands are passed as plain string::
540
-
541
- use Symfony\Component\Console\Command\Command;
542
-
543
- #[AsPeriodicTask(frequency: '1 day', arguments: 'arg --my-option')]
530
+ // when applying this attribute to a Symfony console command, you can pass
531
+ // arguments and options to the command using the 'arguments' option:
532
+ #[AsPeriodicTask(frequency: '1 day', arguments: 'some_argument --some-option --another-option=some_value')]
544
533
class MyCommand extends Command
545
- {
546
- protected function configure(): void
547
- {
548
- $this->addArgument('my-arg');
549
- $this->addOption('my-option');
550
- }
551
- }
552
534
553
535
.. versionadded :: 6.4
554
536
0 commit comments