Skip to content

Commit

Permalink
fx for symfony 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandOrientedTmp committed Jan 10, 2020
1 parent 182a393 commit f956217
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/Command/CleanUpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
use Doctrine\ORM\EntityManager;
use Effiana\JobQueueBundle\Entity\Job;
use Effiana\JobQueueBundle\Entity\Repository\JobManager;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

class CleanUpCommand extends ContainerAwareCommand
class CleanUpCommand extends Command
{
protected static $defaultName = 'effiana:job-queue:clean-up';

Expand Down
4 changes: 2 additions & 2 deletions src/Command/MarkJobIncompleteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
use Doctrine\ORM\EntityManager;
use Effiana\JobQueueBundle\Entity\Job;
use Effiana\JobQueueBundle\Entity\Repository\JobManager;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class MarkJobIncompleteCommand extends ContainerAwareCommand
class MarkJobIncompleteCommand extends Command
{
protected static $defaultName = 'effiana:job-queue:mark-incomplete';

Expand Down
12 changes: 6 additions & 6 deletions src/Command/RunCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
use Symfony\Component\Process\Exception\ProcessFailedException;
use Symfony\Component\Process\Process;

class RunCommand extends \Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand
class RunCommand extends \Symfony\Component\Console\Command\Command
{
protected static $defaultName = 'effiana:job-queue:run';

Expand Down Expand Up @@ -110,8 +110,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
$this->env = $input->getOption('env');
$this->verbose = $input->getOption('verbose');
$this->output = $output;
$this->registry = $this->getContainer()->get('doctrine');
$this->dispatcher = $this->getContainer()->get('event_dispatcher');
$this->registry = $this->getApplication()->getKernel()->getContainer()->get('doctrine');
$this->dispatcher = $this->getApplication()->getKernel()->getContainer()->get('event_dispatcher');
$this->getEntityManager()->getConnection()->getConfiguration()->setSQLLogger(null);

if ($this->verbose) {
Expand All @@ -127,8 +127,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
$idleTime,
$maxJobs,
$restrictedQueues,
$this->getContainer()->getParameter('effiana_job_queue.queue_options_defaults'),
$this->getContainer()->getParameter('effiana_job_queue.queue_options')
$this->getApplication()->getKernel()->getContainer()->getParameter('effiana_job_queue.queue_options_defaults'),
$this->getApplication()->getKernel()->getContainer()->getParameter('effiana_job_queue.queue_options')
);
}

Expand Down Expand Up @@ -434,6 +434,6 @@ private function getEntityManager(): EntityManager
*/
private function getJobManager()
{
return $this->getContainer()->get('effiana_job_queue.job_manager');
return $this->getApplication()->getKernel()->getContainer()->get('effiana_job_queue.job_manager');
}
}

0 comments on commit f956217

Please sign in to comment.