Completed
Branch master (38d957)
by Quim
05:03
created
src/Cmp/Queue/Infrastructure/RabbitMQ/AMQPLazyConnectionSingleton.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -9,6 +9,12 @@
 block discarded – undo
9 9
 
10 10
     private static $amqpLazyConnection;
11 11
 
12
+    /**
13
+     * @param string $host
14
+     * @param string $port
15
+     * @param string $user
16
+     * @param string $password
17
+     */
12 18
     public static function getInstance($host, $port, $user, $password, $vhost = '/')
13 19
     {
14 20
         if(null === static::$amqpLazyConnection) {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 
12 12
     public static function getInstance($host, $port, $user, $password, $vhost = '/')
13 13
     {
14
-        if(null === static::$amqpLazyConnection) {
14
+        if (null === static::$amqpLazyConnection) {
15 15
             static::$amqpLazyConnection = new AMQPLazyConnection($host, $port, $user, $password, $vhost);
16 16
         }
17 17
 
Please login to merge, or discard this patch.
src/Cmp/Queue/Infrastructure/RabbitMQ/RabbitMQReader.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -51,6 +51,9 @@
 block discarded – undo
51 51
         $this->channel->wait();
52 52
     }
53 53
 
54
+    /**
55
+     * @param callable $callback
56
+     */
54 57
     private function initialize($callback)
55 58
     {
56 59
         $this->rabbitMQMessageHandler->setEventCallback($callback);
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 Cmp\Queue\Infrastructure\RabbitMQ;
4 4
 
5 5
 use Cmp\DomainEvent\Domain\Event\DomainEvent;
6
-use Cmp\DomainEvent\Domain\Subscriber\AbstractSubscriber;
7 6
 use Cmp\Queue\Domain\Reader\QueueReader;
8 7
 use Psr\Log\LoggerInterface;
9 8
 
Please login to merge, or discard this patch.
Infrastructure/Subscriber/RabbitMQ/RabbitMQSubscriberInitializer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,9 +54,9 @@
 block discarded – undo
54 54
 
55 55
             $channel->exchange_declare($this->exchange, 'topic', false, true, false);
56 56
 
57
-            list($queueName, ,) = $channel->queue_declare($this->queue, false, false, true, true);
57
+            list($queueName,,) = $channel->queue_declare($this->queue, false, false, true, true);
58 58
 
59
-            foreach($this->domainTopics as $domainTopic) {
59
+            foreach ($this->domainTopics as $domainTopic) {
60 60
                 $this->logger->info('Binding Topic:' . $domainTopic);
61 61
                 $channel->queue_bind($queueName, $this->exchange, $domainTopic);
62 62
             }
Please login to merge, or discard this patch.
src/Cmp/DomainEvent/Domain/Subscriber/Subscriber.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
     public function notify(DomainEvent $domainEvent)
46 46
     {
47 47
         $this->logger->debug('Domain Event received, notifying subscribers');
48
-        foreach($this->subscriptors as $subscriptor) {
48
+        foreach ($this->subscriptors as $subscriptor) {
49 49
             if ($subscriptor->isSubscribed($domainEvent)) {
50 50
                 $subscriptor->notify($domainEvent);
51 51
             }
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
     public function start()
56 56
     {
57
-        while(true) {
57
+        while (true) {
58 58
             $this->queueReader->process(array($this, 'notify'));
59 59
         }
60 60
     }
Please login to merge, or discard this patch.
src/Cmp/Queue/Infrastructure/RabbitMQ/RabbitMQWriter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
             $this->channel = $this->rabbitMQInitializer->initialize();
57 57
         }
58 58
 
59
-        foreach($messages as $message) {
59
+        foreach ($messages as $message) {
60 60
             $encodedMessage = json_encode($message);
61 61
             $this->logger->debug('Writing:' . $encodedMessage);
62 62
             $msg = new AMQPMessage($encodedMessage, array('delivery_mode' => 2));
Please login to merge, or discard this patch.
src/Cmp/Queue/Infrastructure/RabbitMQ/RabbitMQConfig.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
      * @param string $queue
49 49
      * @param string $vhost
50 50
      */
51
-    public function __construct($host, $port, $user, $password, $exchange, $queue='', $vhost='/')
51
+    public function __construct($host, $port, $user, $password, $exchange, $queue = '', $vhost = '/')
52 52
     {
53 53
         $this->host = $host;
54 54
         $this->port = $port;
Please login to merge, or discard this patch.
src/Cmp/Queue/Infrastructure/RabbitMQ/RabbitMQWriterInitializer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,8 +72,8 @@
 block discarded – undo
72 72
     {
73 73
         $channel = $this->connection->channel();
74 74
 
75
-        $exchangeDelayed = self::DELAY_QUEUE_PREFIX.$delay.$this->exchangeName;
76
-        $queueDelayed = self::DELAY_QUEUE_PREFIX.$delay.'Queue';
75
+        $exchangeDelayed = self::DELAY_QUEUE_PREFIX . $delay . $this->exchangeName;
76
+        $queueDelayed = self::DELAY_QUEUE_PREFIX . $delay . 'Queue';
77 77
 
78 78
         // Delay Queue
79 79
         $channel->exchange_declare($exchangeDelayed, 'fanout', false, true, true);
Please login to merge, or discard this patch.
src/Cmp/Queue/Domain/Writer/AbstractWriter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
 
42 42
         if ($numOfDomainObjects === 1) {
43 43
             $this->writeOne($this->messages[0]);
44
-        } else if($numOfDomainObjects > 1) {
44
+        } else if ($numOfDomainObjects > 1) {
45 45
             $this->writeSome($this->messages);
46 46
         }
47 47
         $this->messages = [];
Please login to merge, or discard this patch.
Cmp/Task/Infrastructure/Consumer/RabbitMQ/RabbitMQConsumerInitializer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
 
55 55
             $channel->exchange_declare($this->exchange, 'fanout', false, true, false);
56 56
 
57
-            list($queueName, ,) = $channel->queue_declare($this->queue, false, true, false, false);
57
+            list($queueName,,) = $channel->queue_declare($this->queue, false, true, false, false);
58 58
 
59 59
             $channel->queue_bind($queueName, $this->exchange);
60 60
 
Please login to merge, or discard this patch.