Completed
Push — master ( debbc0...855ad3 )
by Tilita
02:28
created
src/Command/SetupCommand.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      *
27 27
      * @var string
28 28
      */
29
-    protected $description = 'Create all queues, exchanges and binds that are defined in entities AND referenced to' .
29
+    protected $description = 'Create all queues, exchanges and binds that are defined in entities AND referenced to'.
30 30
         ' either a publisher or a consumer';
31 31
 
32 32
     /**
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
58 58
                 $this->output->writeln(
59 59
                     sprintf(
60 60
                         "Created entity <info>%s</info> for publisher [<fg=yellow>%s</>]",
61
-                        (string)$entity->getAliasName(),
62
-                        (string)$publisherName
61
+                        (string) $entity->getAliasName(),
62
+                        (string) $publisherName
63 63
                     )
64 64
                 );
65 65
             } catch (\Exception $e) {
@@ -67,9 +67,9 @@  discard block
 block discarded – undo
67 67
                 $this->output->error(
68 68
                     sprintf(
69 69
                         "Could not create entity %s for publisher [%s], got:\n%s",
70
-                        (string)$entity->getAliasName(),
71
-                        (string)$publisherName,
72
-                        (string)$e->getMessage()
70
+                        (string) $entity->getAliasName(),
71
+                        (string) $publisherName,
72
+                        (string) $e->getMessage()
73 73
                     )
74 74
                 );
75 75
             }
@@ -83,8 +83,8 @@  discard block
 block discarded – undo
83 83
                 $this->output->writeln(
84 84
                     sprintf(
85 85
                         "Created entity <info>%s</info> for consumer [<fg=yellow>%s</>]",
86
-                        (string)$entity->getAliasName(),
87
-                        (string)$consumerAliasName
86
+                        (string) $entity->getAliasName(),
87
+                        (string) $consumerAliasName
88 88
                     )
89 89
                 );
90 90
             } catch (\Exception $e) {
@@ -92,9 +92,9 @@  discard block
 block discarded – undo
92 92
                 $this->output->error(
93 93
                     sprintf(
94 94
                         "Could not create entity %s for consumer [%s], got:\n%s",
95
-                        (string)$entity->getAliasName(),
96
-                        (string)$consumerAliasName,
97
-                        (string)$e->getMessage()
95
+                        (string) $entity->getAliasName(),
96
+                        (string) $consumerAliasName,
97
+                        (string) $e->getMessage()
98 98
                     )
99 99
                 );
100 100
             }
@@ -109,8 +109,8 @@  discard block
 block discarded – undo
109 109
                 $this->output->writeln(
110 110
                     sprintf(
111 111
                         "Created bind <info>%s</info> for publisher [<fg=yellow>%s</>]",
112
-                        (string)$entity->getAliasName(),
113
-                        (string)$publisherName
112
+                        (string) $entity->getAliasName(),
113
+                        (string) $publisherName
114 114
                     )
115 115
                 );
116 116
             } catch (\Exception $e) {
@@ -118,9 +118,9 @@  discard block
 block discarded – undo
118 118
                 $this->output->error(
119 119
                     sprintf(
120 120
                         "Could not bind entity %s for publisher [%s], got:\n%s",
121
-                        (string)$entity->getAliasName(),
122
-                        (string)$publisherName,
123
-                        (string)$e->getMessage()
121
+                        (string) $entity->getAliasName(),
122
+                        (string) $publisherName,
123
+                        (string) $e->getMessage()
124 124
                     )
125 125
                 );
126 126
             }
@@ -133,8 +133,8 @@  discard block
 block discarded – undo
133 133
                 $this->output->writeln(
134 134
                     sprintf(
135 135
                         "Bind entity <info>%s</info> for consumer [<fg=yellow>%s</>]",
136
-                        (string)$entity->getAliasName(),
137
-                        (string)$consumerAliasName
136
+                        (string) $entity->getAliasName(),
137
+                        (string) $consumerAliasName
138 138
                     )
139 139
                 );
140 140
             } catch (\Exception $e) {
@@ -142,13 +142,13 @@  discard block
 block discarded – undo
142 142
                 $this->output->error(
143 143
                     sprintf(
144 144
                         "Could not create bind %s for consumer [%s], got:\n%s",
145
-                        (string)$entity->getAliasName(),
146
-                        (string)$consumerAliasName,
147
-                        (string)$e->getMessage()
145
+                        (string) $entity->getAliasName(),
146
+                        (string) $consumerAliasName,
147
+                        (string) $e->getMessage()
148 148
                     )
149 149
                 );
150 150
             }
151 151
         }
152
-        return (int)$hasErrors;
152
+        return (int) $hasErrors;
153 153
     }
154 154
 }
Please login to merge, or discard this patch.
src/Command/DeleteAllCommand.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      *
27 27
      * @var string
28 28
      */
29
-    protected $description = 'Delete all queues, exchanges and binds that are defined in entities AND referenced to' .
29
+    protected $description = 'Delete all queues, exchanges and binds that are defined in entities AND referenced to'.
30 30
     ' either a publisher or a consumer';
31 31
 
32 32
     /**
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
58 58
                 $this->output->writeln(
59 59
                     sprintf(
60 60
                         "Deleted entity <info>%s</info> for publisher [<fg=yellow>%s</>]",
61
-                        (string)$entity->getAliasName(),
62
-                        (string)$publisherName
61
+                        (string) $entity->getAliasName(),
62
+                        (string) $publisherName
63 63
                     )
64 64
                 );
65 65
             } catch (\Exception $e) {
@@ -67,9 +67,9 @@  discard block
 block discarded – undo
67 67
                 $this->output->error(
68 68
                     sprintf(
69 69
                         "Could not delete entity %s for publisher [%s], got:\n%s",
70
-                        (string)$entity->getAliasName(),
71
-                        (string)$publisherName,
72
-                        (string)$e->getMessage()
70
+                        (string) $entity->getAliasName(),
71
+                        (string) $publisherName,
72
+                        (string) $e->getMessage()
73 73
                     )
74 74
                 );
75 75
             }
@@ -82,8 +82,8 @@  discard block
 block discarded – undo
82 82
                 $this->output->writeln(
83 83
                     sprintf(
84 84
                         "Deleted entity <info>%s</info> for consumer [<fg=yellow>%s</>]",
85
-                        (string)$entity->getAliasName(),
86
-                        (string)$consumerAliasName
85
+                        (string) $entity->getAliasName(),
86
+                        (string) $consumerAliasName
87 87
                     )
88 88
                 );
89 89
             } catch (\Exception $e) {
@@ -91,13 +91,13 @@  discard block
 block discarded – undo
91 91
                 $this->output->error(
92 92
                     sprintf(
93 93
                         "Could not delete entity %s for consumer [%s], got:\n%s",
94
-                        (string)$entity->getAliasName(),
95
-                        (string)$consumerAliasName,
96
-                        (string)$e->getMessage()
94
+                        (string) $entity->getAliasName(),
95
+                        (string) $consumerAliasName,
96
+                        (string) $e->getMessage()
97 97
                     )
98 98
                 );
99 99
             }
100 100
         }
101
-        return (int)$hasErrors;
101
+        return (int) $hasErrors;
102 102
     }
103 103
 }
Please login to merge, or discard this patch.
src/Processor/CliOutputProcessor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
      */
19 19
     public function processMessage(AMQPMessage $message): bool
20 20
     {
21
-        echo $message->getBody() . "\n";
21
+        echo $message->getBody()."\n";
22 22
         return true;
23 23
     }
24 24
 }
Please login to merge, or discard this patch.
src/Builder/ContainerBuilder.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
                 throw new \RuntimeException(
40 40
                     sprintf(
41 41
                         "Cannot create publisher %s: no exchange or queue named %s defined!",
42
-                        (string)$publisherAliasName,
43
-                        (string)$publisherEntityBind
42
+                        (string) $publisherAliasName,
43
+                        (string) $publisherEntityBind
44 44
                     )
45 45
                 );
46 46
             }
@@ -62,8 +62,8 @@  discard block
 block discarded – undo
62 62
                 throw new \RuntimeException(
63 63
                     sprintf(
64 64
                         "Cannot create consumer %s: no queue named %s defined!",
65
-                        (string)$consumerAliasName,
66
-                        (string)$consumerDetails['queue']
65
+                        (string) $consumerAliasName,
66
+                        (string) $consumerDetails['queue']
67 67
                     )
68 68
                 );
69 69
             }
@@ -109,8 +109,8 @@  discard block
 block discarded – undo
109 109
                 throw new \RuntimeException(
110 110
                     sprintf(
111 111
                         "Could not create exchange %s: connection name %s is not defined!",
112
-                        (string)$exchangeAliasName,
113
-                        (string)$exchangeDetails['connection']
112
+                        (string) $exchangeAliasName,
113
+                        (string) $exchangeDetails['connection']
114 114
                     )
115 115
                 );
116 116
             }
@@ -142,8 +142,8 @@  discard block
 block discarded – undo
142 142
                 throw new \RuntimeException(
143 143
                     sprintf(
144 144
                         "Could not create exchange %s: connection name %s is not defined!",
145
-                        (string)$queueAliasName,
146
-                        (string)$queueDetails['connection']
145
+                        (string) $queueAliasName,
146
+                        (string) $queueDetails['connection']
147 147
                     )
148 148
                 );
149 149
             }
Please login to merge, or discard this patch.
src/ConsumerInterface.php 1 patch
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,12 +15,13 @@
 block discarded – undo
15 15
      * @param int $messages The number of message
16 16
      * @param int $seconds  The amount of time a consumer should listen for messages
17 17
      * @param int $maxMemory    The amount of memory when a consumer should stop consuming
18
-     * @return mixed
18
+     * @return integer
19 19
      */
20 20
     public function startConsuming(int $messages, int $seconds, int $maxMemory);
21 21
 
22 22
     /**
23 23
      * Stop the consumer
24
+     * @return void
24 25
      */
25 26
     public function stopConsuming();
26 27
 }
Please login to merge, or discard this patch.
config/laravel_rabbitmq_example.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
             'lazy'               => true,
15 15
 
16 16
             # More info about timeouts can be found on https://www.rabbitmq.com/networking.html
17
-            'read_write_timeout' => 8,   // default timeout for writing/reading (in seconds)
17
+            'read_write_timeout' => 8, // default timeout for writing/reading (in seconds)
18 18
             'connect_timeout'    => 10,
19 19
             'heartbeat'          => 4
20 20
         ]
Please login to merge, or discard this patch.
src/Providers/ServiceProvider.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         $this->publishes([
55 55
             realpath(
56 56
                 dirname(__FILE__)
57
-            ) . '/../../config/laravel_rabbitmq.php' => config_path('laravel_rabbitmq.php'),
57
+            ).'/../../config/laravel_rabbitmq.php' => config_path('laravel_rabbitmq.php'),
58 58
         ]);
59 59
     }
60 60
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 
75 75
         $this->app->singleton(
76 76
             Container::class,
77
-            function () use ($config) {
77
+            function() use ($config) {
78 78
                 $container = new ContainerBuilder();
79 79
                 return $container->createContainer($config);
80 80
             }
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
     private function registerPublishers()
88 88
     {
89 89
         // Get "tagged" like Publisher
90
-        $this->app->singleton(PublisherInterface::class, function (Application $application, $arguments) {
90
+        $this->app->singleton(PublisherInterface::class, function(Application $application, $arguments) {
91 91
             /** @var Container $container */
92 92
             $container = $application->make(Container::class);
93 93
             if (empty($arguments)) {
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
     private function registerConsumers()
105 105
     {
106 106
         // Get "tagged" like Consumers
107
-        $this->app->singleton(ConsumerInterface::class, function (Application $application, $arguments) {
107
+        $this->app->singleton(ConsumerInterface::class, function(Application $application, $arguments) {
108 108
             /** @var Container $container */
109 109
             $container = $application->make(Container::class);
110 110
             if (empty($arguments)) {
Please login to merge, or discard this patch.
src/Processor/AbstractMessageProcessor.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -40,10 +40,10 @@
 block discarded – undo
40 40
             $this->logger->error(
41 41
                 sprintf(
42 42
                     "Could not process message, got %s from %s in %d for message: %s",
43
-                    get_class($e) . '-' . $e->getMessage(),
44
-                    (string)$e->getFile(),
45
-                    (int)$e->getLine(),
46
-                    (string)$message->getBody()
43
+                    get_class($e).'-'.$e->getMessage(),
44
+                    (string) $e->getFile(),
45
+                    (int) $e->getLine(),
46
+                    (string) $message->getBody()
47 47
                 )
48 48
             );
49 49
             $message->delivery_info['channel']->basic_nack($message->delivery_info['delivery_tag'], false, true);
Please login to merge, or discard this patch.
src/Entity/QueueEntity.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -235,9 +235,9 @@  discard block
 block discarded – undo
235 235
                 $this->stopConsuming();
236 236
                 $this->logger->notice(sprintf(
237 237
                     "Stopped consuming: %s in %s:%d",
238
-                    get_class($e) . ' - ' . $e->getMessage(),
239
-                    (string)$e->getFile(),
240
-                    (int)$e->getLine()
238
+                    get_class($e).' - '.$e->getMessage(),
239
+                    (string) $e->getFile(),
240
+                    (int) $e->getLine()
241 241
                 ));
242 242
                 return 1;
243 243
             }
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
                 "Stopped consumer",
266 266
                 [
267 267
                     'limit' => 'memory_limit',
268
-                    'value' => (int)round(memory_get_peak_usage(true) / 1048576, 2)
268
+                    'value' => (int) round(memory_get_peak_usage(true) / 1048576, 2)
269 269
                 ]
270 270
             );
271 271
             return true;
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
         if ($this->getMessageProcessor()->getProcessedMessages() >= $this->limitMessageCount) {
275 275
             $this->logger->debug(
276 276
                 "Stopped consumer",
277
-                ['limit' => 'message_count', 'value' => (int)$this->getMessageProcessor()->getProcessedMessages()]
277
+                ['limit' => 'message_count', 'value' => (int) $this->getMessageProcessor()->getProcessedMessages()]
278 278
             );
279 279
             return true;
280 280
         }
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
         try {
291 291
             $this->getChannel()->basic_cancel($this->getConsumerTag(), false, true);
292 292
         } catch (\Throwable $e) {
293
-            $this->logger->notice("Got " . $e->getMessage() . " of type " . get_class($e));
293
+            $this->logger->notice("Got ".$e->getMessage()." of type ".get_class($e));
294 294
         }
295 295
     }
296 296
 
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
     private function registerShutdownHandler()
342 342
     {
343 343
         $consumer = $this;
344
-        register_shutdown_function(function () use ($consumer) {
344
+        register_shutdown_function(function() use ($consumer) {
345 345
             $consumer->stopConsuming();
346 346
         });
347 347
     }
@@ -411,8 +411,8 @@  discard block
 block discarded – undo
411 411
                 sprintf(
412 412
                     "Got %s from %s in %d",
413 413
                     $e->getMessage(),
414
-                    (string)$e->getFile(),
415
-                    (int)$e->getLine()
414
+                    (string) $e->getFile(),
415
+                    (int) $e->getLine()
416 416
                 )
417 417
             );
418 418
             // let the exception slide, the processor should handle
Please login to merge, or discard this patch.