Test Failed
Push — master ( 84b385...188679 )
by Daniel
10:55
created
Transport/Subscriber/Publisher.php 3 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -17,6 +17,10 @@
 block discarded – undo
17 17
     private $exchange;
18 18
     private $exchangeType;
19 19
 
20
+    /**
21
+     * @param string $exchange
22
+     * @param string $fromName
23
+     */
20 24
     public function __construct(
21 25
         $exchange,
22 26
         $exchangeType = ExchangeType::FANOUT,
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace Cmobi\RabbitmqBundle\Transport\Subscriber;
4 4
 
5
-use Cmobi\RabbitmqBundle\Connection\CmobiAMQPChannel;
6 5
 use Cmobi\RabbitmqBundle\Connection\CmobiAMQPConnectionInterface;
7 6
 use Cmobi\RabbitmqBundle\Connection\ConnectionManager;
8 7
 use Cmobi\RabbitmqBundle\Queue\CmobiAMQPMessage;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
         $channel = $connection->channel();
44 44
         $queueBag = new SubscriberQueueBag($this->getExchange(), $this->getExchangeType(), $this->getQueueName());
45 45
         $channel->exchangeDeclare($queueBag->getExchangeDeclare());
46
-        $msg = new CmobiAMQPMessage((string) $data);
46
+        $msg = new CmobiAMQPMessage((string)$data);
47 47
         $channel->basic_publish($msg, $queueBag->getExchange());
48 48
 
49 49
         $channel->close();
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/Task.php 2 patches
Doc Comments   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,6 +16,10 @@  discard block
 block discarded – undo
16 16
     private $fromName;
17 17
     private $queueName;
18 18
 
19
+    /**
20
+     * @param string $queueName
21
+     * @param string $fromName
22
+     */
19 23
     public function __construct($queueName, ConnectionManager $manager, $fromName)
20 24
     {
21 25
         $this->queueName = $queueName;
@@ -107,7 +111,7 @@  discard block
 block discarded – undo
107 111
     }
108 112
 
109 113
     /**
110
-     * @return string
114
+     * @return boolean
111 115
      */
112 116
     public function getExchange()
113 117
     {
@@ -115,7 +119,7 @@  discard block
 block discarded – undo
115 119
     }
116 120
 
117 121
     /**
118
-     * @return string
122
+     * @return boolean
119 123
      */
120 124
     public function getExchangeType()
121 125
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,13 +35,13 @@
 block discarded – undo
35 35
         $connection = $this->connectionManager->getConnection();
36 36
         $channel = $connection->channel();
37 37
 
38
-        if (! $this->queueHasExists($channel)) {
38
+        if (!$this->queueHasExists($channel)) {
39 39
             throw new QueueNotFoundException("Queue $this->queueName not declared.");
40 40
         }
41 41
         $queueBag = new WorkerQueueBag($this->getQueueName());
42 42
         $channel->queueDeclare($queueBag->getQueueDeclare());
43 43
         $msg = new CmobiAMQPMessage(
44
-            (string) $data,
44
+            (string)$data,
45 45
             [
46 46
                 'delivery_mode' => 2, // make message persistent
47 47
                 'priority' => $priority,
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
@@ -145,17 +145,17 @@
 block discarded – undo
145 145
         do {
146 146
             try {
147 147
                 $failed = false;
148
-                fwrite($this->logOutput, 'start Queue::forceReconnect() - trying connect...' . PHP_EOL);
148
+                fwrite($this->logOutput, 'start Queue::forceReconnect() - trying connect...'.PHP_EOL);
149 149
                 $this->connection = $this->getConnectionManager()->getConnection($this->connectionName);
150 150
                 $this->channel = $this->getConnection()->channel();
151 151
                 $this->createQueue();
152 152
             } catch (\Exception $e) {
153 153
                 $failed = true;
154 154
                 sleep(3);
155
-                fwrite($this->errOutput, 'failed Queue::forceReconnect() - ' . $e->getMessage() . PHP_EOL);
155
+                fwrite($this->errOutput, 'failed Queue::forceReconnect() - '.$e->getMessage().PHP_EOL);
156 156
             }
157 157
         } while ($failed);
158
-        fwrite($this->logOutput, 'Queue::forceReconnect() - connected!' . PHP_EOL);
158
+        fwrite($this->logOutput, 'Queue::forceReconnect() - connected!'.PHP_EOL);
159 159
 
160 160
         return $this->channel;
161 161
     }
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.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -83,13 +83,13 @@  discard block
 block discarded – undo
83 83
         $connection = $this->connectionManager->getConnection($this->connectionName);
84 84
         $channel = $connection->channel();
85 85
 
86
-        if (! $this->queueHasExists($channel)) {
86
+        if (!$this->queueHasExists($channel)) {
87 87
             throw new QueueNotFoundException("Queue $this->queueName not declared.");
88 88
         }
89
-        $sufix = Uuid::uuid4()->toString() . microtime();
89
+        $sufix = Uuid::uuid4()->toString().microtime();
90 90
         $this->createCallbackQueue($channel, $expire, $sufix);
91 91
         $msg = new CmobiAMQPMessage(
92
-            (string) $data,
92
+            (string)$data,
93 93
             [
94 94
                 'correlation_id' => $this->correlationId,
95 95
                 'reply_to' => $this->callbackQueue,
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
         );
99 99
         $channel->basic_publish($msg, '', $this->getQueueName());
100 100
 
101
-        while (! $this->response) {
101
+        while (!$this->response) {
102 102
             try {
103 103
                 $channel->wait(null, 0, ($expire / 1000));
104 104
             } catch (\Exception $e) {
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
     /** @return string */
169 169
     public function generateCorrelationId()
170 170
     {
171
-        return uniqid($this->getQueueName()) . Uuid::uuid4()->toString() . microtime();
171
+        return uniqid($this->getQueueName()).Uuid::uuid4()->toString().microtime();
172 172
     }
173 173
 
174 174
     /**
@@ -215,16 +215,16 @@  discard block
 block discarded – undo
215 215
         try {
216 216
             $connection->close();
217 217
             sleep(2);
218
-            fwrite($this->logOutput, 'start RpcClient::forceReconnect() - trying connect...' . PHP_EOL);
218
+            fwrite($this->logOutput, 'start RpcClient::forceReconnect() - trying connect...'.PHP_EOL);
219 219
             $connection = $this->getConnectionManager()->getConnection($this->connectionName);
220 220
             $channel = $connection->channel();
221 221
             $this->createCallbackQueue($channel, $expire, $sufix, $corralationId);
222 222
         } catch (\Exception $e) {
223
-            fwrite($this->errOutput, 'failed RpcClient::forceReconnect() - ' . $e->getMessage() . PHP_EOL);
223
+            fwrite($this->errOutput, 'failed RpcClient::forceReconnect() - '.$e->getMessage().PHP_EOL);
224 224
 
225 225
             return $connection;
226 226
         }
227
-        fwrite($this->logOutput, 'RpcClient::forceReconnect() - connected!' . PHP_EOL);
227
+        fwrite($this->logOutput, 'RpcClient::forceReconnect() - connected!'.PHP_EOL);
228 228
 
229 229
         return $connection;
230 230
     }
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -3,13 +3,11 @@
 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\CmobiAMQPConnectionInterface;
8 7
 use Cmobi\RabbitmqBundle\Connection\ConnectionManager;
9 8
 use Cmobi\RabbitmqBundle\Queue\CmobiAMQPMessage;
10 9
 use Cmobi\RabbitmqBundle\Queue\QueueProducerInterface;
11 10
 use Cmobi\RabbitmqBundle\Transport\Exception\QueueNotFoundException;
12
-use PhpAmqpLib\Exception\AMQPTimeoutException;
13 11
 use PhpAmqpLib\Message\AMQPMessage;
14 12
 use Ramsey\Uuid\Uuid;
15 13
 
Please login to merge, or discard this patch.