Skip to content

Commit

Permalink
Fix command issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
klelostec committed Sep 7, 2022
1 parent 3473c64 commit 8c5c34a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/Command/DrupGardCron.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Command;

use App\Entity\Project;
use App\Exception\AnalyseException;
use App\Service\AnalyseHelper;
use Doctrine\ORM\EntityManagerInterface;
Expand Down Expand Up @@ -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');
Expand Down
3 changes: 2 additions & 1 deletion src/Command/DrupGardList.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down
3 changes: 2 additions & 1 deletion src/Command/DrupGardResetStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/Command/DrupGardRun.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 8c5c34a

Please sign in to comment.