@@ -282,7 +282,7 @@ |
||
282 | 282 | 'body' => [ |
283 | 283 | 'originFileName' => 'test.csv', |
284 | 284 | 'error' => 'The import file could not be imported due to a fatal error. ' . |
285 | - 'Please check its integrity and try again!', |
|
285 | + 'Please check its integrity and try again!', |
|
286 | 286 | ], |
287 | 287 | 'contentType' => 'text/html', |
288 | 288 | ] |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | ->method('runUnique') |
363 | 363 | ->with(1, 'oro:import:processor_test:test_import:1') |
364 | 364 | ->will( |
365 | - $this->returnCallback(function ($jobId, $name, $callback) use ($jobRunner, $childJob) { |
|
365 | + $this->returnCallback(function($jobId, $name, $callback) use ($jobRunner, $childJob) { |
|
366 | 366 | return $callback($jobRunner, $childJob); |
367 | 367 | }) |
368 | 368 | ); |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | ->method('createDelayed') |
373 | 373 | ->with('oro:import:processor_test:test_import:1:chunk.1') |
374 | 374 | ->will( |
375 | - $this->returnCallback(function ($jobId, $callback) use ($jobRunner, $childJob1) { |
|
375 | + $this->returnCallback(function($jobId, $callback) use ($jobRunner, $childJob1) { |
|
376 | 376 | return $callback($jobRunner, $childJob1); |
377 | 377 | }) |
378 | 378 | ); |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | ->method('createDelayed') |
383 | 383 | ->with('oro:import:processor_test:test_import:1:chunk.2') |
384 | 384 | ->will( |
385 | - $this->returnCallback(function ($jobId, $callback) use ($jobRunner, $childJob2) { |
|
385 | + $this->returnCallback(function($jobId, $callback) use ($jobRunner, $childJob2) { |
|
386 | 386 | return $callback($jobRunner, $childJob2); |
387 | 387 | }) |
388 | 388 | ); |
@@ -126,7 +126,7 @@ |
||
126 | 126 | 'originFileName' => 'originFileName', |
127 | 127 | 'userId' => 1, |
128 | 128 | 'process' => ProcessorRegistry::TYPE_IMPORT, |
129 | - ])) |
|
129 | + ])) |
|
130 | 130 | ; |
131 | 131 | $result = $processor->process($message, $this->createSessionMock()); |
132 | 132 | $this->assertEquals(MessageProcessorInterface::REJECT, $result); |
@@ -42,7 +42,7 @@ |
||
42 | 42 | |
43 | 43 | public function testSendImportNotificationProcessShouldReturnSubscribedTopics() |
44 | 44 | { |
45 | - $expectedSubscribedTopics = [Topics::SEND_IMPORT_NOTIFICATION,]; |
|
45 | + $expectedSubscribedTopics = [Topics::SEND_IMPORT_NOTIFICATION, ]; |
|
46 | 46 | $this->assertEquals($expectedSubscribedTopics, SendImportNotificationMessageProcessor::getSubscribedTopics()); |
47 | 47 | } |
48 | 48 |
@@ -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 | } |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | ['processorAlias' => $processor] |
164 | 164 | )); |
165 | 165 | $this->template = tempnam( |
166 | - $this->getKernel()->getRootDir().DIRECTORY_SEPARATOR.'import_export', |
|
166 | + $this->getKernel()->getRootDir() . DIRECTORY_SEPARATOR . 'import_export', |
|
167 | 167 | 'import_template_' |
168 | 168 | ); |
169 | 169 | |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | public function iFillTemplateWithData(TableNode $table) |
358 | 358 | { |
359 | 359 | $this->importFile = tempnam( |
360 | - $this->getKernel()->getRootDir().DIRECTORY_SEPARATOR.'import_export', |
|
360 | + $this->getKernel()->getRootDir() . DIRECTORY_SEPARATOR . 'import_export', |
|
361 | 361 | 'import_data_' |
362 | 362 | ); |
363 | 363 | $fp = fopen($this->importFile, 'w'); |
@@ -422,12 +422,12 @@ discard block |
||
422 | 422 | $fileManager = $this->getContainer()->get('oro_importexport.file.file_manager'); |
423 | 423 | $files = $fileManager->getFilesByPeriod(); |
424 | 424 | |
425 | - $exportFiles = array_filter($files, function (File $file) { |
|
425 | + $exportFiles = array_filter($files, function(File $file) { |
|
426 | 426 | return preg_match('/export_\d{4}.*.csv/', $file->getName()); |
427 | 427 | }); |
428 | 428 | |
429 | 429 | // sort by modification date |
430 | - usort($exportFiles, function (File $a, File $b) { |
|
430 | + usort($exportFiles, function(File $a, File $b) { |
|
431 | 431 | return $b->getMtime() > $a->getMtime(); |
432 | 432 | }); |
433 | 433 | |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | $importSubmitButton = $this->createElement('ImportModalImportFileButton'); |
478 | 478 | |
479 | 479 | if (false === $importSubmitButton->isIsset()) { |
480 | - $mainImportButton =$this->createElement('MainImportFileButton'); |
|
480 | + $mainImportButton = $this->createElement('MainImportFileButton'); |
|
481 | 481 | self::assertNotNull($mainImportButton, 'Main import button was not found'); |
482 | 482 | $mainImportButton->click(); |
483 | 483 | $this->waitForAjax(); |
@@ -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); |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | */ |
76 | 76 | public function splitFile($pathFile) |
77 | 77 | { |
78 | - if (! ($this->writer && $this->reader)) { |
|
78 | + if (!($this->writer && $this->reader)) { |
|
79 | 79 | throw new InvalidConfigurationException('Reader and Writer must be configured.'); |
80 | 80 | } |
81 | 81 | |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | */ |
144 | 144 | public function mergeFiles(array $files, $summaryFile) |
145 | 145 | { |
146 | - if (! ($this->writer && $this->reader)) { |
|
146 | + if (!($this->writer && $this->reader)) { |
|
147 | 147 | throw new InvalidConfigurationException('Reader and Writer must be configured.'); |
148 | 148 | } |
149 | 149 | $contextWriter = null; |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $contextReader = new Context(['filePath' => $file]); |
152 | 152 | $this->reader->initializeByContext($contextReader); |
153 | 153 | while ($item = $this->reader->read($contextReader)) { |
154 | - if (! $contextWriter) { |
|
154 | + if (!$contextWriter) { |
|
155 | 155 | $contextWriter = new Context( |
156 | 156 | [ |
157 | 157 | 'filePath' => $summaryFile, |
@@ -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(); |