Skip to content

Commit d4ead5f

Browse files
fx
1 parent 82460c1 commit d4ead5f

10 files changed

Lines changed: 33 additions & 9 deletions

src/Command/CleanUpCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,16 @@ protected function configure()
3737
;
3838
}
3939

40-
protected function execute(InputInterface $input, OutputInterface $output)
40+
protected function execute(InputInterface $input, OutputInterface $output): int
4141
{
4242
/** @var EntityManager $em */
4343
$em = $this->registry->getManagerForClass(Job::class);
4444
$con = $em->getConnection();
4545

4646
$this->cleanUpExpiredJobs($em, $con, $input);
4747
$this->collectStaleJobs($em);
48+
49+
return 0;
4850
}
4951

5052
private function collectStaleJobs(EntityManager $em)

src/Command/MarkJobIncompleteCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ protected function configure()
3434
;
3535
}
3636

37-
protected function execute(InputInterface $input, OutputInterface $output)
37+
protected function execute(InputInterface $input, OutputInterface $output): int
3838
{
3939
/** @var EntityManager $em */
4040
$em = $this->registry->getManagerForClass(Job::class);

src/Command/RunCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ protected function configure()
7373
;
7474
}
7575

76-
protected function execute(InputInterface $input, OutputInterface $output)
76+
protected function execute(InputInterface $input, OutputInterface $output): int
7777
{
7878
$startTime = time();
7979

@@ -134,6 +134,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
134134
$this->getApplication()->getKernel()->getContainer()->getParameter('effiana_job_queue.queue_options_defaults'),
135135
$this->getApplication()->getKernel()->getContainer()->getParameter('effiana_job_queue.queue_options')
136136
);
137+
138+
return 0;
137139
}
138140

139141
private function runJobs($workerName, $startTime, $maxRuntime, $idleTime, $maxJobs, array $restrictedQueues, array $queueOptionsDefaults, array $queueOptions)

src/Command/ScheduleCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ protected function configure()
4141
;
4242
}
4343

44-
protected function execute(InputInterface $input, OutputInterface $output)
44+
protected function execute(InputInterface $input, OutputInterface $output): int
4545
{
4646
$maxRuntime = $input->getOption('max-runtime');
4747
if ($maxRuntime > 300) {

src/Tests/Functional/AppKernel.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,19 @@ public function unserialize($config)
7979
{
8080
$this->__construct($config);
8181
}
82+
83+
protected function getKernelParameters(): array
84+
{
85+
//get the original params
86+
$parameters = parent::getKernelParameters();
87+
$webDir = sprintf('%s/web', realpath($this->getProjectDir()) ?: $this->getProjectDir());
88+
//and merge it with ours.
89+
return array_merge(
90+
[
91+
'kernel.root_dir' => $this->getProjectDir(),
92+
'kernel.web_dir' => $webDir,
93+
],
94+
$parameters
95+
);
96+
}
8297
}

src/Tests/Functional/TestBundle/Command/LoggingCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
namespace Effiana\JobQueueBundle\Tests\Functional\TestBundle\Command;
44

55
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
6+
use Symfony\Component\Console\Command\Command;
67
use Symfony\Component\Console\Input\InputArgument;
78
use Symfony\Component\Console\Input\InputInterface;
89
use Symfony\Component\Console\Input\InputOption;
910
use Symfony\Component\Console\Output\OutputInterface;
1011

11-
class LoggingCommand extends ContainerAwareCommand
12+
class LoggingCommand extends Command
1213
{
1314
protected function configure()
1415
{

src/Tests/Functional/TestBundle/Command/NeverEndingCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
namespace Effiana\JobQueueBundle\Tests\Functional\TestBundle\Command;
44

5+
use Symfony\Component\Console\Command\Command;
56
use Symfony\Component\Console\Input\InputInterface;
67
use Symfony\Component\Console\Output\OutputInterface;
78

8-
class NeverEndingCommand extends \Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand
9+
class NeverEndingCommand extends Command
910
{
1011
protected function configure()
1112
{

src/Tests/Functional/TestBundle/Command/SometimesFailingCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22

33
namespace Effiana\JobQueueBundle\Tests\Functional\TestBundle\Command;
44

5+
use Symfony\Component\Console\Command\Command;
56
use Symfony\Component\Console\Input\InputArgument;
67
use Symfony\Component\Console\Input\InputInterface;
78
use Symfony\Component\Console\Output\OutputInterface;
89

9-
class SometimesFailingCommand extends \Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand
10+
class SometimesFailingCommand extends Command
1011
{
1112
protected function configure()
1213
{

src/Tests/Functional/TestBundle/Command/SuccessfulCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
namespace Effiana\JobQueueBundle\Tests\Functional\TestBundle\Command;
44

5+
use Symfony\Component\Console\Command\Command;
56
use Symfony\Component\Console\Input\InputInterface;
67
use Symfony\Component\Console\Output\OutputInterface;
78

8-
class SuccessfulCommand extends \Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand
9+
class SuccessfulCommand extends Command
910
{
1011
protected function configure()
1112
{

src/Tests/Functional/TestBundle/Command/ThrowsExceptionCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
namespace Effiana\JobQueueBundle\Tests\Functional\TestBundle\Command;
44

55
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
6+
use Symfony\Component\Console\Command\Command;
67
use Symfony\Component\Console\Input\InputInterface;
78
use Symfony\Component\Console\Output\OutputInterface;
89

9-
class ThrowsExceptionCommand extends ContainerAwareCommand
10+
class ThrowsExceptionCommand extends Command
1011
{
1112
protected function configure()
1213
{

0 commit comments

Comments
 (0)