src/Viserio/Component/Cron/Command/ScheduleRunCommand.php
public function handle(Schedule $schedule): int
    {
        $options   = self::resolveOptions($this->getContainer()->get('config'));
        $cronJobs  = $schedule->dueCronJobs(
            $options['env'],
            $options['maintenance']
        );

        $cronJobsRan = 0;

        /** @var Cron $cronJob */
        foreach ($cronJobs as $cronJob) {
            if (! $cronJob->filtersPass()) {
                continue;
            }

            $this->line('<info>Running scheduled command:</info> ' . $cronJob->getSummaryForDisplay());

            $cronJob->run();

            $cronJobsRan++;
        }

        if (\count($cronJobs) === 0 || $cronJobsRan === 0) {
            $this->info('No scheduled commands are ready to run.');
        }

        return 0;
    }
public function handle(Schedule $schedule): int
    {
        $options   = self::resolveOptions($this->getContainer()->get('config'));
        $cronJobs  = $schedule->dueCronJobs(
            $options['env'],
            $options['maintenance']
        );

        $cronJobsRan = 0;

        /** @var Cron $cronJob */
        foreach ($cronJobs as $cronJob) {
            if (! $cronJob->filtersPass()) {
                continue;
            }

            $this->line('<info>Running scheduled command:</info> ' . $cronJob->getSummaryForDisplay());

            $cronJob->run();

            $cronJobsRan++;
        }

        if (\count($cronJobs) === 0 || $cronJobsRan === 0) {
            $this->info('No scheduled commands are ready to run.');
        }

        return 0;
    }
{@inheritdoc}

@param \Viserio\Component\Cron\Schedule $schedule