Test Setup Failed
Push — master ( bd24c5...78b3b3 )
by Matthew
03:09 queued 01:16
created
Command/CreateJobCommand.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -2,11 +2,9 @@
 block discarded – undo
2 2
 namespace Dtc\QueueBundle\Command;
3 3
 
4 4
 use Dtc\QueueBundle\Documents\Job;
5
-
6 5
 use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
7 6
 use Symfony\Component\Console\Input\InputArgument;
8 7
 use Symfony\Component\Console\Input\InputInterface;
9
-use Symfony\Component\Console\Input\InputOption;
10 8
 use Symfony\Component\Console\Output\OutputInterface;
11 9
 
12 10
 class CreateJobCommand
Please login to merge, or discard this patch.
Command/PruneCommand.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -2,9 +2,7 @@
 block discarded – undo
2 2
 namespace Dtc\QueueBundle\Command;
3 3
 
4 4
 use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
5
-use Symfony\Component\Console\Input\InputArgument;
6 5
 use Symfony\Component\Console\Input\InputInterface;
7
-use Symfony\Component\Console\Input\InputOption;
8 6
 use Symfony\Component\Console\Output\OutputInterface;
9 7
 
10 8
 class PruneCommand
Please login to merge, or discard this patch.
Controller/QueueController.php 1 patch
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -3,10 +3,7 @@
 block discarded – undo
3 3
 
4 4
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
5 5
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
6
-
7 6
 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
8
-use Symfony\Component\HttpFoundation\Response;
9
-use Symfony\Component\HttpFoundation\Request;
10 7
 
11 8
 class QueueController
12 9
     extends Controller
Please login to merge, or discard this patch.
Documents/JobManager.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -11,6 +11,9 @@
 block discarded – undo
11 11
     protected $dm;
12 12
     protected $documentName;
13 13
 
14
+    /**
15
+     * @param string $documentName
16
+     */
14 17
     public function __construct(DocumentManager $dm, $documentName)
15 18
     {
16 19
         $this->dm = $dm;
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -179,8 +179,7 @@
 block discarded – undo
179 179
 
180 180
         if ($prioritize) {
181 181
             $qb->sort('priority', 'asc');
182
-        }
183
-        else {
182
+        } else {
184 183
             $qb->sort('when', 'asc');
185 184
         }
186 185
 
Please login to merge, or discard this patch.
RabbitMQ/JobManager.php 4 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -33,6 +33,9 @@
 block discarded – undo
33 33
         return $job;
34 34
     }
35 35
 
36
+    /**
37
+     * @param string $workerName
38
+     */
36 39
     public function getJob($workerName = null, $methodName = null, $prioritize = true)
37 40
     {
38 41
         if ($methodName) {
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 
4 4
 use Dtc\QueueBundle\Model\Job as BaseJob;
5 5
 use Dtc\QueueBundle\Model\JobManagerInterface;
6
-
7 6
 use PhpAmqpLib\Connection\AMQPConnection;
8 7
 use PhpAmqpLib\Message\AMQPMessage;
9 8
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,12 +15,12 @@
 block discarded – undo
15 15
 
16 16
     public function __construct(AMQPConnection $connection) {
17 17
         $this->connection = $connection;
18
-        $this->channel = $connection->channel();;
18
+        $this->channel = $connection->channel(); ;
19 19
     }
20 20
 
21 21
     public function save($job) {
22 22
         $queue = $job->getWorkerName();
23
-        $exchange = null; 	// User default exchange
23
+        $exchange = null; // User default exchange
24 24
 
25 25
         $this->channel->queue_declare($queue, false, true, false, false);
26 26
         $this->channel->exchange_declare($exchange, 'direct', false, true, false);
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,8 +57,7 @@
 block discarded – undo
57 57
         if ($job->getStatus() === BaseJob::STATUS_SUCCESS) {
58 58
             $this->beanstalkd
59 59
                 ->delete($job);
60
-        }
61
-        else {
60
+        } else {
62 61
             $this->beanstalkd
63 62
                 ->bury($job);
64 63
         }
Please login to merge, or discard this patch.
Tests/Model/BaseJobManagerTest.php 2 patches
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -2,9 +2,6 @@
 block discarded – undo
2 2
 namespace Dtc\QueueBundle\Tests\Model;
3 3
 
4 4
 use Dtc\QueueBundle\Model\Job;
5
-use Dtc\QueueBundle\Tests\FibonacciWorker;
6
-use Dtc\QueueBundle\Tests\StaticJobManager;
7
-use Dtc\QueueBundle\Model\WorkerManager;
8 5
 
9 6
 class BaseJobManagerTest
10 7
     extends \PHPUnit_Framework_TestCase
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@
 block discarded – undo
83 83
     public function testPerformance() {
84 84
         $start = microtime(true);
85 85
         $jobsTotal = 1000;
86
-        self::$jobManager->enableSorting = false;	// Ignore priority
86
+        self::$jobManager->enableSorting = false; // Ignore priority
87 87
 
88 88
         for ($i = 0; $i < $jobsTotal; $i++) {
89 89
             self::$worker->later()->fibonacci(1);
Please login to merge, or discard this patch.
Tests/Model/JobTest.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 use Dtc\QueueBundle\Model\Job;
5 5
 use Dtc\QueueBundle\Tests\FibonacciWorker;
6 6
 use Dtc\QueueBundle\Tests\StaticJobManager;
7
-use Dtc\QueueBundle\Model\WorkerManager;
8 7
 
9 8
 class JobTest
10 9
     extends \PHPUnit_Framework_TestCase
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
         $worker = new FibonacciWorker();
14 14
         $job = new Job($worker, false, null);
15 15
         $job->setArgs(array(1));
16
-        $job->setArgs(array(1, array(1,2)));
16
+        $job->setArgs(array(1, array(1, 2)));
17 17
 
18 18
         try {
19 19
             $job->setArgs(array($job));
Please login to merge, or discard this patch.
Tests/Model/WorkerTest.php 3 patches
Doc Comments   +5 added lines patch added patch discarded remove patch
@@ -104,6 +104,11 @@
 block discarded – undo
104 104
         }
105 105
     }
106 106
 
107
+    /**
108
+     * @param integer|null $time
109
+     * @param string $method
110
+     * @param integer $priority
111
+     */
107 112
     protected function assertJob(Job $job, $time, $method, $priority = null) {
108 113
         $this->assertNotEmpty($job->getId(), "Job should have an id");
109 114
 
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 use Dtc\QueueBundle\Model\Job;
5 5
 use Dtc\QueueBundle\Tests\FibonacciWorker;
6 6
 use Dtc\QueueBundle\Tests\StaticJobManager;
7
-use Dtc\QueueBundle\Model\WorkerManager;
8 7
 
9 8
 class WorkerTest
10 9
     extends \PHPUnit_Framework_TestCase
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -115,8 +115,7 @@
 block discarded – undo
115 115
         if ($priority) {
116 116
             $this->assertEquals($priority, $job->getPriority(),
117 117
                     "Priority should be the same.");
118
-        }
119
-        else {
118
+        } else {
120 119
             $this->assertNull($job->getPriority(), "Priority should be null");
121 120
         }
122 121
 
Please login to merge, or discard this patch.
Tests/RabbitMQ/JobManager.php 1 patch
Unused Use Statements   -5 removed lines patch added patch discarded remove patch
@@ -3,14 +3,9 @@
 block discarded – undo
3 3
 
4 4
 use Dtc\QueueBundle\RabbitMQ\JobManager;
5 5
 use Dtc\QueueBundle\Model\Job;
6
-use Dtc\QueueBundle\Model\WorkerManager;
7
-
8 6
 use Dtc\QueueBundle\Tests\FibonacciWorker;
9
-use Dtc\QueueBundle\Tests\StaticJobManager;
10 7
 use Dtc\QueueBundle\Tests\Model\BaseJobManagerTest;
11
-
12 8
 use PhpAmqpLib\Connection\AMQPConnection;
13
-use PhpAmqpLib\Message\AMQPMessage;
14 9
 
15 10
 /**
16 11
  * @author David
Please login to merge, or discard this patch.