Completed
Push — refactor-quim ( 7ccf46...14758d )
by Quim
03:52
created
src/Infrastructure/AmqpLib/v26/RabbitMQ/Queue/QueueReader.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
      * @param int $timeout
95 95
      * @throws ReaderException
96 96
      */
97
-    public function read(callable $callback, $timeout=0)
97
+    public function read(callable $callback, $timeout = 0)
98 98
     {
99 99
         $this->initialize();
100 100
         $this->messageHandler->setCallback($callback);
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
      */
107 107
     protected function initialize()
108 108
     {
109
-        if($this->channel) {
109
+        if ($this->channel) {
110 110
             return;
111 111
         }
112 112
         $this->logger->info('Connecting to RabbitMQ');
Please login to merge, or discard this patch.
src/Domain/Event/Subscriber.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -42,15 +42,15 @@  discard block
 block discarded – undo
42 42
         return $this;
43 43
     }
44 44
 
45
-    public function start($timeout=0)
45
+    public function start($timeout = 0)
46 46
     {
47
-        if(!isset($this->subscriptors[0])) {
47
+        if (!isset($this->subscriptors[0])) {
48 48
             throw new DomainEventException('You must add at least 1 EventSubscriptor in order to publish start reading from queue.');
49 49
         }
50
-        while(true) {
50
+        while (true) {
51 51
             try {
52 52
                 $this->queueReader->read(array($this, 'notify'), $timeout);
53
-            } catch(\Exception $e) {
53
+            } catch (\Exception $e) {
54 54
                 break;
55 55
             }
56 56
         }
@@ -62,8 +62,8 @@  discard block
 block discarded – undo
62 62
     public function notify(DomainEvent $domainEvent)
63 63
     {
64 64
         $this->logger->info('Domain Event received, notifying subscribers');
65
-        foreach($this->subscriptors as $subscriptor) {
66
-            if($subscriptor->isSubscribed($domainEvent)) {
65
+        foreach ($this->subscriptors as $subscriptor) {
66
+            if ($subscriptor->isSubscribed($domainEvent)) {
67 67
                 $subscriptor->notify($domainEvent);
68 68
             }
69 69
         }
Please login to merge, or discard this patch.
src/Domain/Queue/QueueReader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,5 +17,5 @@
 block discarded – undo
17 17
      * @throws ReaderException
18 18
      * @return void
19 19
      */
20
-    public function read(callable $callback, $timeout=0);
20
+    public function read(callable $callback, $timeout = 0);
21 21
 }
22 22
\ No newline at end of file
Please login to merge, or discard this patch.
src/Domain/Task/Consumer.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,12 +19,12 @@
 block discarded – undo
19 19
         $this->queueReader = $queueReader;
20 20
     }
21 21
 
22
-    public function consume(callable $callback, $timeout=0)
22
+    public function consume(callable $callback, $timeout = 0)
23 23
     {
24
-        while(true) {
24
+        while (true) {
25 25
             try {
26 26
                 $this->queueReader->read($callback, $timeout);
27
-            } catch(\Exception $e) {
27
+            } catch (\Exception $e) {
28 28
                 break;
29 29
             }
30 30
         }
Please login to merge, or discard this patch.