diff --git a/Exporter/AnnotationCronExporter.php b/Exporter/AnnotationCronExporter.php index 82e3bff..f787fdb 100644 --- a/Exporter/AnnotationCronExporter.php +++ b/Exporter/AnnotationCronExporter.php @@ -7,6 +7,7 @@ use MyBuilder\Bundle\CronosBundle\Annotation\Cron as CronAnnotation; use MyBuilder\Cronos\Formatter\Cron as CronFormatter; use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Command\LazyCommand; class AnnotationCronExporter { @@ -32,6 +33,9 @@ public function export(array $commands, array $options): CronFormatter $cron = $this->createCronConfiguration(); foreach ($commands as $command) { + if ($command instanceof LazyCommand) { + $command = $command->getCommand(); + } if ($command instanceof Command) { $cron = $this->parseAnnotations($cron, $command, $options); }