mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
DX: apply rector rules up to php8.0
This commit is contained in:
@@ -46,30 +46,11 @@ class CronManager implements CronManagerInterface
|
||||
|
||||
private const UPDATE_BEFORE_EXEC = 'UPDATE ' . CronJobExecution::class . ' cr SET cr.lastStart = :now WHERE cr.key = :key';
|
||||
|
||||
private CronJobExecutionRepositoryInterface $cronJobExecutionRepository;
|
||||
|
||||
private EntityManagerInterface $entityManager;
|
||||
|
||||
/**
|
||||
* @var iterable<CronJobInterface>
|
||||
*/
|
||||
private iterable $jobs;
|
||||
|
||||
private LoggerInterface $logger;
|
||||
|
||||
/**
|
||||
* @param CronJobInterface[] $jobs
|
||||
*/
|
||||
public function __construct(
|
||||
CronJobExecutionRepositoryInterface $cronJobExecutionRepository,
|
||||
EntityManagerInterface $entityManager,
|
||||
iterable $jobs,
|
||||
LoggerInterface $logger
|
||||
) {
|
||||
$this->cronJobExecutionRepository = $cronJobExecutionRepository;
|
||||
$this->entityManager = $entityManager;
|
||||
$this->jobs = $jobs;
|
||||
$this->logger = $logger;
|
||||
public function __construct(private CronJobExecutionRepositoryInterface $cronJobExecutionRepository, private EntityManagerInterface $entityManager, private iterable $jobs, private LoggerInterface $logger)
|
||||
{
|
||||
}
|
||||
|
||||
public function run(?string $forceJob = null): void
|
||||
@@ -115,7 +96,7 @@ class CronManager implements CronManagerInterface
|
||||
$this->logger->info(sprintf('%sSuccessfully run job', self::LOG_PREFIX), ['job' => $job->getKey()]);
|
||||
|
||||
return;
|
||||
} catch (Exception $e) {
|
||||
} catch (Exception) {
|
||||
$this->logger->error(sprintf('%sRunning job failed', self::LOG_PREFIX), ['job' => $job->getKey()]);
|
||||
$this->entityManager
|
||||
->createQuery(self::UPDATE_AFTER_EXEC)
|
||||
|
Reference in New Issue
Block a user