@@ -43,16 +43,16 @@ discard block |
||
| 43 | 43 | return $this; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - public function start($timeout=0) |
|
| 46 | + public function start($timeout = 0) |
|
| 47 | 47 | { |
| 48 | - if(!isset($this->subscriptors[0])) { |
|
| 48 | + if (!isset($this->subscriptors[0])) { |
|
| 49 | 49 | throw new DomainEventException('You must add at least 1 EventSubscriptor in order to publish start reading from queue.'); |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - while(true) { |
|
| 52 | + while (true) { |
|
| 53 | 53 | try { |
| 54 | 54 | $this->queueReader->read(array($this, 'notify'), $timeout); |
| 55 | - } catch(TimeoutReaderException $e) { |
|
| 55 | + } catch (TimeoutReaderException $e) { |
|
| 56 | 56 | break; |
| 57 | 57 | } |
| 58 | 58 | } |
@@ -64,8 +64,8 @@ discard block |
||
| 64 | 64 | public function notify(DomainEvent $domainEvent) |
| 65 | 65 | { |
| 66 | 66 | $this->logger->debug('Domain Event received, notifying subscribers'); |
| 67 | - foreach($this->subscriptors as $subscriptor) { |
|
| 68 | - if($subscriptor->isSubscribed($domainEvent)) { |
|
| 67 | + foreach ($this->subscriptors as $subscriptor) { |
|
| 68 | + if ($subscriptor->isSubscribed($domainEvent)) { |
|
| 69 | 69 | $subscriptor->notify($domainEvent); |
| 70 | 70 | } |
| 71 | 71 | } |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | 'TopicArn' => $this->topicArn, |
| 64 | 64 | 'Message' => json_encode($message), |
| 65 | 65 | ]); |
| 66 | - } catch(\Exception $e) { |
|
| 66 | + } catch (\Exception $e) { |
|
| 67 | 67 | $this->logger->error('Error writing messages', ['exception' => $e]); |
| 68 | 68 | throw new WriterException($e->getMessage(), $e->getCode()); |
| 69 | 69 | } |
@@ -68,15 +68,15 @@ |
||
| 68 | 68 | * @throws TimeoutReaderException |
| 69 | 69 | * @throws ReaderException |
| 70 | 70 | */ |
| 71 | - public function read(callable $callback, $timeout=0) |
|
| 71 | + public function read(callable $callback, $timeout = 0) |
|
| 72 | 72 | { |
| 73 | 73 | $this->messageHandler->setCallback($callback); |
| 74 | 74 | |
| 75 | 75 | try { |
| 76 | 76 | $this->consume($timeout); |
| 77 | - } catch(TimeoutReaderException $e) { |
|
| 77 | + } catch (TimeoutReaderException $e) { |
|
| 78 | 78 | throw $e; |
| 79 | - } catch(\Exception $e) { |
|
| 79 | + } catch (\Exception $e) { |
|
| 80 | 80 | throw new ReaderException("Error occurred while reading", 0, $e); |
| 81 | 81 | } |
| 82 | 82 | } |
@@ -170,7 +170,7 @@ |
||
| 170 | 170 | 'Condition' => [ |
| 171 | 171 | 'ArnEquals' => [ |
| 172 | 172 | 'aws:SourceArn' => $topicArn, |
| 173 | - ], |
|
| 173 | + ], |
|
| 174 | 174 | ], |
| 175 | 175 | ], |
| 176 | 176 | ], |