Completed
Push — master ( bfb363...ace2c0 )
by Daniel
03:56
created
Transport/Subscriber/SubscriberQueueCallback.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
      */
29 29
     public function toClosure()
30 30
     {
31
-        return function (AMQPMessage $message) {
31
+        return function(AMQPMessage $message) {
32 32
             $this->getQueueService()->handle($message);
33 33
         };
34 34
     }
Please login to merge, or discard this patch.
Tests/Transport/Rpc/RpcClientOld.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@
 block discarded – undo
129 129
 
130 130
     /**
131 131
      * @param string $msg
132
-     * @param null   $correlationId
132
+     * @param string   $correlationId
133 133
      *
134 134
      * @return CmobiAMQPMessage
135 135
      */
Please login to merge, or discard this patch.
Transport/Subscriber/SubscriberBuilder.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
     }
26 26
 
27 27
     /**
28
-     * @param $queueName
28
+     * @param string $queueName
29 29
      * @param QueueServiceInterface $queueService
30 30
      * @param QueueBagInterface $queueBag
31 31
      * @return Queue
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
      */
31 31
     public function buildQueue($queueName, QueueServiceInterface $queueService, QueueBagInterface $queueBag)
32 32
     {
33
-        if (! $queueBag instanceof SubscriberQueueBag) {
33
+        if (!$queueBag instanceof SubscriberQueueBag) {
34 34
             throw new \Exception('Unsupported QueueBag');
35 35
         }
36 36
         $queue = new Queue($this->getConnectionManager(), $queueBag, $this->connectionName);
Please login to merge, or discard this patch.
Transport/Worker/WorkerBuilder.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
     }
26 26
 
27 27
     /**
28
-     * @param $queueName
28
+     * @param string $queueName
29 29
      * @param QueueServiceInterface $queueService
30 30
      * @param QueueBagInterface $queueBag
31 31
      * @return Queue
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
      */
31 31
     public function buildQueue($queueName, QueueServiceInterface $queueService, QueueBagInterface $queueBag)
32 32
     {
33
-        if (! $queueBag instanceof WorkerQueueBag) {
33
+        if (!$queueBag instanceof WorkerQueueBag) {
34 34
             throw new \Exception('Unsupported QueueBag');
35 35
         }
36 36
         $queue = new Queue($this->getConnectionManager(), $queueBag, $this->connectionName);
Please login to merge, or discard this patch.
Queue/Queue.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,6 @@
 block discarded – undo
6 6
 use Cmobi\RabbitmqBundle\Connection\CmobiAMQPConnection;
7 7
 use Cmobi\RabbitmqBundle\Connection\ConnectionManager;
8 8
 use Cmobi\RabbitmqBundle\Connection\Exception\InvalidAMQPChannelException;
9
-use Psr\Log\LoggerInterface;
10 9
 
11 10
 class Queue implements QueueInterface
12 11
 {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -143,17 +143,17 @@
 block discarded – undo
143 143
         do {
144 144
             try {
145 145
                 $failed = false;
146
-                fwrite($this->logOutput, 'start Queue::forceReconnect() - trying connect...' . PHP_EOL);
146
+                fwrite($this->logOutput, 'start Queue::forceReconnect() - trying connect...'.PHP_EOL);
147 147
                 $this->connection = $this->getConnectionManager()->getConnection($this->connectionName);
148 148
                 $this->channel = $this->getConnection()->channel();
149 149
                 $this->createQueue();
150 150
             } catch (\Exception $e) {
151 151
                 $failed = true;
152 152
                 sleep(3);
153
-                fwrite($this->logOutput, 'failed Queue::forceReconnect() - ' . $e->getMessage() . PHP_EOL);
153
+                fwrite($this->logOutput, 'failed Queue::forceReconnect() - '.$e->getMessage().PHP_EOL);
154 154
             }
155 155
         } while ($failed);
156
-        fwrite($this->logOutput, 'Queue::forceReconnect() - connected!' . PHP_EOL);
156
+        fwrite($this->logOutput, 'Queue::forceReconnect() - connected!'.PHP_EOL);
157 157
 
158 158
         return $this->channel;
159 159
     }
Please login to merge, or discard this patch.
Transport/Rpc/RpcClient.php 3 patches
Doc Comments   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,6 +22,10 @@  discard block
 block discarded – undo
22 22
     private $correlationId;
23 23
     private $callbackQueue;
24 24
 
25
+    /**
26
+     * @param string $queueName
27
+     * @param string $fromName
28
+     */
25 29
     public function __construct($queueName, ConnectionManager $manager, $fromName, $connectionName = 'default')
26 30
     {
27 31
         $this->connectionName = $connectionName;
@@ -43,7 +47,7 @@  discard block
 block discarded – undo
43 47
     }
44 48
 
45 49
     /**
46
-     * @param $data
50
+     * @param string $data
47 51
      * @param int $expire
48 52
      * @param int $priority
49 53
      * @throws QueueNotFoundException
@@ -133,7 +137,7 @@  discard block
 block discarded – undo
133 137
     /**
134 138
      * @todo unecessary method set, its only exists to run tests whitout stay jailed in infinite while waiting response.
135 139
      *
136
-     * @param $content
140
+     * @param string $content
137 141
      */
138 142
     public function setResponse($content)
139 143
     {
@@ -163,7 +167,7 @@  discard block
 block discarded – undo
163 167
     }
164 168
 
165 169
     /**
166
-     * @return string
170
+     * @return boolean
167 171
      */
168 172
     public function getExchange()
169 173
     {
@@ -171,7 +175,7 @@  discard block
 block discarded – undo
171 175
     }
172 176
 
173 177
     /**
174
-     * @return string
178
+     * @return boolean
175 179
      */
176 180
     public function getExchangeType()
177 181
     {
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
 namespace Cmobi\RabbitmqBundle\Transport\Rpc;
4 4
 
5 5
 use Cmobi\RabbitmqBundle\Connection\CmobiAMQPChannel;
6
-use Cmobi\RabbitmqBundle\Connection\CmobiAMQPConnection;
7 6
 use Cmobi\RabbitmqBundle\Connection\ConnectionManager;
8 7
 use Cmobi\RabbitmqBundle\Queue\CmobiAMQPMessage;
9 8
 use Cmobi\RabbitmqBundle\Queue\QueueProducerInterface;
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
         $connection = $this->connectionManager->getConnection($this->connectionName);
56 56
         $channel = $connection->channel();
57 57
 
58
-        if (! $this->queueHasExists($channel)) {
58
+        if (!$this->queueHasExists($channel)) {
59 59
             throw new QueueNotFoundException("Queue $this->queueName not declared.");
60 60
         }
61 61
         $this->correlationId = $this->generateCorrelationId();
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
             [$this, 'onResponse']
81 81
         );
82 82
         $msg = new CmobiAMQPMessage(
83
-            (string) $data,
83
+            (string)$data,
84 84
             [
85 85
                 'correlation_id' => $this->correlationId,
86 86
                 'reply_to' => $this->callbackQueue,
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
         );
90 90
         $channel->basic_publish($msg, '', $this->getQueueName());
91 91
 
92
-        while (! $this->response) {
92
+        while (!$this->response) {
93 93
             $channel->wait(null, 0, ($expire / 1000));
94 94
         }
95 95
         $channel->close();
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
     /** @return string */
152 152
     public function generateCorrelationId()
153 153
     {
154
-        return uniqid($this->getQueueName()) . Uuid::uuid4()->toString() . microtime();
154
+        return uniqid($this->getQueueName()).Uuid::uuid4()->toString().microtime();
155 155
     }
156 156
 
157 157
     /**
Please login to merge, or discard this patch.