@@ -107,7 +107,7 @@ |
||
107 | 107 | 'file' => 'file' , |
108 | 108 | 'error' => 'error test', |
109 | 109 | 'userId' => 1, |
110 | - ])) |
|
110 | + ])) |
|
111 | 111 | ; |
112 | 112 | $result = $processor->process($message, $this->createSessionMock()); |
113 | 113 | $this->assertEquals(MessageProcessorInterface::REJECT, $result); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | public function testSendImportNotificationProcessShouldReturnSubscribedTopics() |
37 | 37 | { |
38 | - $expectedSubscribedTopics = [Topics::SEND_IMPORT_ERROR_NOTIFICATION,]; |
|
38 | + $expectedSubscribedTopics = [Topics::SEND_IMPORT_ERROR_NOTIFICATION, ]; |
|
39 | 39 | $this->assertEquals( |
40 | 40 | $expectedSubscribedTopics, |
41 | 41 | SendImportErrorNotificationMessageProcessor::getSubscribedTopics() |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | ->expects($this->once()) |
105 | 105 | ->method('getBody') |
106 | 106 | ->willReturn(json_encode([ |
107 | - 'file' => 'file' , |
|
107 | + 'file' => 'file', |
|
108 | 108 | 'error' => 'error test', |
109 | 109 | 'userId' => 1, |
110 | 110 | ])) |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | ->expects($this->once()) |
183 | 183 | ->method('getBody') |
184 | 184 | ->willReturn(json_encode([ |
185 | - 'file' => 'import.csv' , |
|
185 | + 'file' => 'import.csv', |
|
186 | 186 | 'error' => 'error import', |
187 | 187 | 'userId' => 1, |
188 | 188 | ])); |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | ->expects($this->once()) |
244 | 244 | ->method('getBody') |
245 | 245 | ->willReturn(json_encode([ |
246 | - 'file' => 'import.csv' , |
|
246 | + 'file' => 'import.csv', |
|
247 | 247 | 'error' => 'error import', |
248 | 248 | 'notifyEmail' => '[email protected]', |
249 | 249 | ])); |
@@ -82,8 +82,8 @@ discard block |
||
82 | 82 | public function uniqueJobResultProvider() |
83 | 83 | { |
84 | 84 | return [ |
85 | - [ true, PreExportMessageProcessorAbstract::ACK ], |
|
86 | - [ false, PreExportMessageProcessorAbstract::REJECT ], |
|
85 | + [true, PreExportMessageProcessorAbstract::ACK], |
|
86 | + [false, PreExportMessageProcessorAbstract::REJECT], |
|
87 | 87 | ]; |
88 | 88 | } |
89 | 89 | |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | ->expects($this->once()) |
165 | 165 | ->method('runUnique') |
166 | 166 | ->with($this->equalTo($message->getMessageId()), $this->equalTo($jobUniqueName)) |
167 | - ->will($this->returnCallback(function ($jobId, $name, $callback) use ($jobRunner, $childJob) { |
|
167 | + ->will($this->returnCallback(function($jobId, $name, $callback) use ($jobRunner, $childJob) { |
|
168 | 168 | return $callback($jobRunner, $childJob); |
169 | 169 | })) |
170 | 170 | ; |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | $jobRunner |
173 | 173 | ->expects($this->once()) |
174 | 174 | ->method('createDelayed') |
175 | - ->with($jobUniqueName.'.chunk.1') |
|
175 | + ->with($jobUniqueName . '.chunk.1') |
|
176 | 176 | ; |
177 | 177 | |
178 | 178 | $tokenStorage = $this->createTokenStorageMock(); |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | ->expects($this->once()) |
286 | 286 | ->method('runUnique') |
287 | 287 | ->with($this->equalTo($message->getMessageId()), $this->equalTo($jobUniqueName)) |
288 | - ->will($this->returnCallback(function ($jobId, $name, $callback) use ($jobRunner, $childJob) { |
|
288 | + ->will($this->returnCallback(function($jobId, $name, $callback) use ($jobRunner, $childJob) { |
|
289 | 289 | return $callback($jobRunner, $childJob); |
290 | 290 | })) |
291 | 291 | ; |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | $jobRunner |
294 | 294 | ->expects($this->once()) |
295 | 295 | ->method('createDelayed') |
296 | - ->with($jobUniqueName.'.chunk.1') |
|
296 | + ->with($jobUniqueName . '.chunk.1') |
|
297 | 297 | ; |
298 | 298 | |
299 | 299 | $token = $this->createTokenMock(); |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | ->expects($this->once()) |
390 | 390 | ->method('runUnique') |
391 | 391 | ->with($this->equalTo($message->getMessageId()), $this->equalTo($jobUniqueName)) |
392 | - ->will($this->returnCallback(function ($jobId, $name, $callback) use ($jobRunner, $childJob) { |
|
392 | + ->will($this->returnCallback(function($jobId, $name, $callback) use ($jobRunner, $childJob) { |
|
393 | 393 | return $callback($jobRunner, $childJob); |
394 | 394 | })) |
395 | 395 | ; |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | $jobRunner |
398 | 398 | ->expects($this->once()) |
399 | 399 | ->method('createDelayed') |
400 | - ->with($jobUniqueName.'.chunk.1') |
|
400 | + ->with($jobUniqueName . '.chunk.1') |
|
401 | 401 | ; |
402 | 402 | |
403 | 403 | $user = $this->createUserStub(); |
@@ -504,19 +504,19 @@ discard block |
||
504 | 504 | ->expects($this->once()) |
505 | 505 | ->method('runUnique') |
506 | 506 | ->with($this->equalTo($message->getMessageId()), $this->equalTo($jobUniqueName)) |
507 | - ->will($this->returnCallback(function ($jobId, $name, $callback) use ($jobRunner, $childJob) { |
|
507 | + ->will($this->returnCallback(function($jobId, $name, $callback) use ($jobRunner, $childJob) { |
|
508 | 508 | return $callback($jobRunner, $childJob); |
509 | 509 | })) |
510 | 510 | ; |
511 | 511 | $jobRunner |
512 | 512 | ->expects($this->at(0)) |
513 | 513 | ->method('createDelayed') |
514 | - ->with($jobUniqueName.'.chunk.1') |
|
514 | + ->with($jobUniqueName . '.chunk.1') |
|
515 | 515 | ; |
516 | 516 | $jobRunner |
517 | 517 | ->expects($this->at(1)) |
518 | 518 | ->method('createDelayed') |
519 | - ->with($jobUniqueName.'.chunk.2') |
|
519 | + ->with($jobUniqueName . '.chunk.2') |
|
520 | 520 | ; |
521 | 521 | |
522 | 522 | $user = $this->createUserStub(); |
@@ -710,7 +710,7 @@ discard block |
||
710 | 710 | */ |
711 | 711 | private function getAnonymousFunction() |
712 | 712 | { |
713 | - return function () { |
|
713 | + return function() { |
|
714 | 714 | }; |
715 | 715 | } |
716 | 716 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | { |
49 | 49 | $reader = $this->getJobReader($jobName, $processorType); |
50 | 50 | |
51 | - if (! $reader instanceof AbstractFileReader) { |
|
51 | + if (!$reader instanceof AbstractFileReader) { |
|
52 | 52 | throw new LogicException('Reader must be instance of AbstractFileReader'); |
53 | 53 | } |
54 | 54 | $this->batchFileManager->setReader($reader); |
@@ -167,13 +167,13 @@ discard block |
||
167 | 167 | $counts['process'] = 0; |
168 | 168 | $counts['read'] = $context->getReadCount(); |
169 | 169 | $counts['process'] += $counts['add'] = $context->getAddCount(); |
170 | - $counts['process'] += $counts['replace'] = $context->getReplaceCount(); |
|
170 | + $counts['process'] += $counts['replace'] = $context->getReplaceCount(); |
|
171 | 171 | $counts['process'] += $counts['update'] = $context->getUpdateCount(); |
172 | 172 | $counts['process'] += $counts['delete'] = $context->getDeleteCount(); |
173 | 173 | $counts['error_entries'] = $context->getErrorEntriesCount(); |
174 | 174 | $counts['errors'] += count($context->getErrors()); |
175 | 175 | // for cases when data wasn't imported |
176 | - if (! $jobResult->isSuccessful()) { |
|
176 | + if (!$jobResult->isSuccessful()) { |
|
177 | 177 | $counts['add'] = $counts['replace'] = $counts['update'] = $counts['delete'] = 0; |
178 | 178 | } |
179 | 179 | return $counts; |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | */ |
172 | 172 | public function getExportingEntityIds($jobName, $processorType, $processorAlias, $options) |
173 | 173 | { |
174 | - if (! ($reader = $this->getJobReader($jobName, $processorType)) instanceof BatchIdsReaderInterface) { |
|
174 | + if (!($reader = $this->getJobReader($jobName, $processorType)) instanceof BatchIdsReaderInterface) { |
|
175 | 175 | return []; |
176 | 176 | } |
177 | 177 | |
@@ -199,10 +199,10 @@ discard block |
||
199 | 199 | $fileName = FileManager::generateFileName($processorType, $outputFormat); |
200 | 200 | $localFilePath = FileManager::generateTmpFilePath($fileName); |
201 | 201 | |
202 | - if (! ($writer = $this->writerChain->getWriter($outputFormat)) instanceof FileStreamWriter) { |
|
202 | + if (!($writer = $this->writerChain->getWriter($outputFormat)) instanceof FileStreamWriter) { |
|
203 | 203 | throw new LogicException('Writer must be instance of FileStreamWriter'); |
204 | 204 | } |
205 | - if (! ($reader = $this->readerChain->getReader($outputFormat)) instanceof AbstractFileReader) { |
|
205 | + if (!($reader = $this->readerChain->getReader($outputFormat)) instanceof AbstractFileReader) { |
|
206 | 206 | throw new LogicException('Reader must be instance of AbstractFileReader'); |
207 | 207 | } |
208 | 208 | $this->batchFileManager->setWriter($writer); |
@@ -48,7 +48,7 @@ |
||
48 | 48 | |
49 | 49 | $data = $this->getFile()->fgetcsv(); |
50 | 50 | if (false !== $data) { |
51 | - if (! $context instanceof ContextInterface) { |
|
51 | + if (!$context instanceof ContextInterface) { |
|
52 | 52 | $context = $this->getContext(); |
53 | 53 | } |
54 | 54 | $context->incrementReadOffset(); |
@@ -463,7 +463,7 @@ |
||
463 | 463 | $jobExecutor->getJobFailureExceptions($jobCode), |
464 | 464 | $jobExecutor->getJobErrors($jobCode) |
465 | 465 | ); |
466 | - $content = implode("\r\n", $errors); |
|
466 | + $content = implode("\r\n", $errors); |
|
467 | 467 | |
468 | 468 | return new Response($content, 200, ['Content-Type' => 'text/x-log']); |
469 | 469 | } |
@@ -110,7 +110,7 @@ |
||
110 | 110 | public function getFailureExceptions() |
111 | 111 | { |
112 | 112 | return array_map( |
113 | - function ($e) { |
|
113 | + function($e) { |
|
114 | 114 | return $e['message']; |
115 | 115 | }, |
116 | 116 | $this->failureExceptions |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | */ |
32 | 32 | protected function validateMessageBody($body) |
33 | 33 | { |
34 | - if (! isset( |
|
34 | + if (!isset( |
|
35 | 35 | $body['userId'], |
36 | 36 | $body['jobName'], |
37 | 37 | $body['process'], |
@@ -69,11 +69,11 @@ discard block |
||
69 | 69 | $result = $this->jobRunner->runUnique( |
70 | 70 | $parentMessageId, |
71 | 71 | $jobName, |
72 | - function (JobRunner $jobRunner, Job $job) use ($jobName, $body, $files) { |
|
72 | + function(JobRunner $jobRunner, Job $job) use ($jobName, $body, $files) { |
|
73 | 73 | foreach ($files as $key => $file) { |
74 | 74 | $jobRunner->createDelayed( |
75 | 75 | sprintf('%s:chunk.%s', $jobName, ++$key), |
76 | - function (JobRunner $jobRunner, Job $child) use ($body, $file, $key) { |
|
76 | + function(JobRunner $jobRunner, Job $child) use ($body, $file, $key) { |
|
77 | 77 | $body['fileName'] = $file; |
78 | 78 | $body['options']['batch_number'] = $key; |
79 | 79 | $this->producer->send( |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | ->getRepository(User::class) |
130 | 130 | ->find($body['userId']); |
131 | 131 | |
132 | - if (! $user instanceof User) { |
|
132 | + if (!$user instanceof User) { |
|
133 | 133 | $this->logger->critical( |
134 | 134 | sprintf('User not found. Id: %s', $body['userId']) |
135 | 135 | ); |
@@ -175,7 +175,7 @@ |
||
175 | 175 | |
176 | 176 | $body = $this->validateMessageBody($body); |
177 | 177 | |
178 | - if (! $body) { |
|
178 | + if (!$body) { |
|
179 | 179 | return self::REJECT; |
180 | 180 | } |
181 | 181 |