Skip to content

Commit

Permalink
Changed return value of CronRunCommand::execute from null to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwojs committed Mar 23, 2020
1 parent 449c37a commit d64a865
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/bundle/Command/CronRunCommand.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<?php

/**
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace EzSystems\EzPlatformCronBundle\Command;

use Cron\Cron;
Expand All @@ -14,7 +17,7 @@
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

class CronRunCommand extends Command
final class CronRunCommand extends Command
{
/** @var \EzSystems\EzPlatformCronBundle\Registry\CronJobsRegistry */
private $cronJobsRegistry;
Expand All @@ -26,7 +29,7 @@ public function __construct(CronJobsRegistry $cronJobsRegistry, ?string $name =
$this->cronJobsRegistry = $cronJobsRegistry;
}

protected function configure()
protected function configure(): void
{
$this
->setDefinition([
Expand All @@ -43,7 +46,7 @@ protected function configure()
);
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$category = $input->getOption('category');
$cronJobs = $this->cronJobsRegistry->getCategoryCronJobs($category);
Expand All @@ -55,5 +58,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$cron->setResolver($resolver);

$cron->run();

return 0;
}
}

0 comments on commit d64a865

Please # to comment.