From 8c5c34ab1d0aec1faa3baea210ada135ca35790c Mon Sep 17 00:00:00 2001 From: klelostec Date: Wed, 7 Sep 2022 23:01:25 +0200 Subject: [PATCH] Fix command issue. --- src/Command/DrupGardCron.php | 3 ++- src/Command/DrupGardList.php | 3 ++- src/Command/DrupGardResetStatus.php | 3 ++- src/Command/DrupGardRun.php | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Command/DrupGardCron.php b/src/Command/DrupGardCron.php index bb156b8..7fac324 100644 --- a/src/Command/DrupGardCron.php +++ b/src/Command/DrupGardCron.php @@ -2,6 +2,7 @@ namespace App\Command; +use App\Entity\Project; use App\Exception\AnalyseException; use App\Service\AnalyseHelper; use Doctrine\ORM\EntityManagerInterface; @@ -41,7 +42,7 @@ protected function configure() protected function execute(InputInterface $input, OutputInterface $output) { //Add needed project to queue - $repo = $this->entityManager->getRepository("App:Project"); + $repo = $this->entityManager->getRepository(Project::class); $projects = $repo->findByCronNeeded(boolval($input->getOption('cron-only'))); foreach ($projects as $project) { $command = $this->getApplication()->find('drupguard:run'); diff --git a/src/Command/DrupGardList.php b/src/Command/DrupGardList.php index a0cdfda..179870c 100644 --- a/src/Command/DrupGardList.php +++ b/src/Command/DrupGardList.php @@ -2,6 +2,7 @@ namespace App\Command; +use App\Entity\Project; use Doctrine\Common\Collections\Criteria; use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\Console\Command\Command; @@ -37,7 +38,7 @@ protected function execute(InputInterface $input, OutputInterface $output) { $table = new Table($output); $table->setHeaders(['Project name', 'Machine name', 'Cron frequency', 'Last analyse', 'Last analyse state', 'Is running', 'Pending']); - $repo = $this->entityManager->getRepository("App:Project"); + $repo = $this->entityManager->getRepository(Project::class); if ($filter = $input->getOption('filter')) { // Add a not equals parameter to your criteria $criteria = new Criteria(); diff --git a/src/Command/DrupGardResetStatus.php b/src/Command/DrupGardResetStatus.php index 19f5748..b3a7bdf 100644 --- a/src/Command/DrupGardResetStatus.php +++ b/src/Command/DrupGardResetStatus.php @@ -2,6 +2,7 @@ namespace App\Command; +use App\Entity\Project; use App\Service\AnalyseHelper; use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\Console\Command\Command; @@ -34,7 +35,7 @@ protected function configure() protected function execute(InputInterface $input, OutputInterface $output) { - $repo = $this->entityManager->getRepository("App:Project"); + $repo = $this->entityManager->getRepository(Project::class); $projectsMachineNames = $input->getArgument('projects'); if (count($projectsMachineNames) > 0) { diff --git a/src/Command/DrupGardRun.php b/src/Command/DrupGardRun.php index c38ad7d..96ebafc 100644 --- a/src/Command/DrupGardRun.php +++ b/src/Command/DrupGardRun.php @@ -41,7 +41,7 @@ protected function configure() protected function execute(InputInterface $input, OutputInterface $output) { - $repo = $this->entityManager->getRepository("App:Project"); + $repo = $this->entityManager->getRepository(Project::class); $projectsMachineNames = $input->getArgument('projects'); if (count($projectsMachineNames) > 0) {