File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -473,6 +473,20 @@ 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')]
481
+ class MyCommand extends Command
482
+ {
483
+ protected function configure(): void
484
+ {
485
+ $this->addArgument('my-arg');
486
+ $this->addOption('my-option');
487
+ }
488
+ }
489
+
476
490
.. versionadded :: 6.4
477
491
478
492
The :class: `Symfony\\ Component\\ Scheduler\\ Attribute\\ AsCronTask ` attribute
@@ -522,6 +536,20 @@ The ``#[AsPeriodicTask]`` attribute takes many parameters to customize the trigg
522
536
}
523
537
}
524
538
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')]
544
+ class MyCommand extends Command
545
+ {
546
+ protected function configure(): void
547
+ {
548
+ $this->addArgument('my-arg');
549
+ $this->addOption('my-option');
550
+ }
551
+ }
552
+
525
553
.. versionadded :: 6.4
526
554
527
555
The :class: `Symfony\\ Component\\ Scheduler\\ Attribute\\ AsPeriodicTask ` attribute
You can’t perform that action at this time.
0 commit comments