@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | $event = new DocumentPreSaveEvent($document); |
| 176 | 176 | $this->getEventDispatcher()->dispatch($event, DocumentPreSaveEvent::NAME); |
| 177 | 177 | } |
| 178 | - if($this->enableAsync) { |
|
| 178 | + if ($this->enableAsync) { |
|
| 179 | 179 | $this->bus->dispatch(new SaveDocumentMessage($document)); |
| 180 | 180 | return; |
| 181 | 181 | } |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | } |
| 195 | 195 | $document = $this->getEntityToDocumentMapper()->createDocument($manager, $entity); |
| 196 | 196 | if ($document !== null) { |
| 197 | - if($this->enableAsync) { |
|
| 197 | + if ($this->enableAsync) { |
|
| 198 | 198 | $this->bus->dispatch(new RemoveDocumentMessage($document)); |
| 199 | 199 | return; |
| 200 | 200 | } |
@@ -141,7 +141,9 @@ |
||
| 141 | 141 | * @param LifecycleEventArgs $args |
| 142 | 142 | */ |
| 143 | 143 | public function postUpdate(LifecycleEventArgs $args): void { |
| 144 | - if (!$this->enableIndexing) return; |
|
| 144 | + if (!$this->enableIndexing) { |
|
| 145 | + return; |
|
| 146 | + } |
|
| 145 | 147 | $this->updateEntity($args->getObject(), $args->getObjectManager()); |
| 146 | 148 | } |
| 147 | 149 | |
@@ -14,11 +14,11 @@ |
||
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | public function __invoke(DocumentMessage $message): void { |
| 17 | - if($message instanceof SaveDocumentMessage) { |
|
| 17 | + if ($message instanceof SaveDocumentMessage) { |
|
| 18 | 18 | $this->searchService->saveDocument($message->getDocument()); |
| 19 | 19 | $this->em->flush(); |
| 20 | 20 | } |
| 21 | - if($message instanceof RemoveDocumentMessage) { |
|
| 21 | + if ($message instanceof RemoveDocumentMessage) { |
|
| 22 | 22 | $this->searchService->removeDocument($message->getDocument()); |
| 23 | 23 | $this->em->flush(); |
| 24 | 24 | } |