@@ -17,7 +17,7 @@ |
||
17 | 17 | { |
18 | 18 | $loader = new YamlFileLoader( |
19 | 19 | $container, |
20 | - new FileLocator(__DIR__.'/../Resources/config') |
|
20 | + new FileLocator(__DIR__ . '/../Resources/config') |
|
21 | 21 | ); |
22 | 22 | $loader->load('services.yml'); |
23 | 23 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | |
116 | 116 | $endPos = $this->findPosition($data, $this->processorConfiguration['endConditions']); |
117 | 117 | if (is_null($endPos)) { |
118 | - throw new Exception('End condition not reached at the '.(count($blocks) + 1).'nth loop of block.'); |
|
118 | + throw new Exception('End condition not reached at the ' . (count($blocks) + 1) . 'nth loop of block.'); |
|
119 | 119 | } else { |
120 | 120 | $blockData = substr($data, 0, $endPos); |
121 | 121 | $data = substr($data, $endPos); |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | } |
331 | 331 | |
332 | 332 | // clean "false positive" space groups |
333 | - $spaceGroups = array_filter($spaceGroups, function ($spaceGroup) { |
|
333 | + $spaceGroups = array_filter($spaceGroups, function($spaceGroup) { |
|
334 | 334 | return $spaceGroup['end'] - $spaceGroup['start'] > 1; |
335 | 335 | }); |
336 | 336 | |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | { |
348 | 348 | foreach ($newRow as $newRowColumnIndex => $newRowColumnValue) { |
349 | 349 | if (strlen($newRowColumnValue)) { |
350 | - $row[$newRowColumnIndex] = trim($row[$newRowColumnIndex]."\n".$newRowColumnValue); |
|
350 | + $row[$newRowColumnIndex] = trim($row[$newRowColumnIndex] . "\n" . $newRowColumnValue); |
|
351 | 351 | } |
352 | 352 | } |
353 | 353 | |
@@ -361,14 +361,14 @@ discard block |
||
361 | 361 | */ |
362 | 362 | private function getTextVersion($filePath) |
363 | 363 | { |
364 | - $tmpPath = $this->temporaryDirectoryPath.'/'.rand(0, 10000).'.txt'; |
|
365 | - $process = new Process('/usr/bin/pdftotext -layout '.$filePath.' '.$tmpPath); |
|
364 | + $tmpPath = $this->temporaryDirectoryPath . '/' . rand(0, 10000) . '.txt'; |
|
365 | + $process = new Process('/usr/bin/pdftotext -layout ' . $filePath . ' ' . $tmpPath); |
|
366 | 366 | $this->logger->info('Execute Pdftotext', ['file' => $filePath]); |
367 | - $process->run(function ($type, $buffer) { |
|
367 | + $process->run(function($type, $buffer) { |
|
368 | 368 | if (Process::ERR === $type) { |
369 | - echo 'ERR > '.$buffer; |
|
369 | + echo 'ERR > ' . $buffer; |
|
370 | 370 | } else { |
371 | - echo 'OUT > '.$buffer; |
|
371 | + echo 'OUT > ' . $buffer; |
|
372 | 372 | } |
373 | 373 | }); |
374 | 374 |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | public function format(ArrayCollection $data) |
28 | 28 | { |
29 | - $data = $data->map(function ($item) { |
|
29 | + $data = $data->map(function($item) { |
|
30 | 30 | // Date |
31 | 31 | $dateRaw = $item[1]; |
32 | 32 | $date = new \DateTime(); |
@@ -35,10 +35,10 @@ discard block |
||
35 | 35 | |
36 | 36 | // Value |
37 | 37 | if (strlen($item[3])) { |
38 | - $value = abs((float) str_replace(',', '.', str_replace(' ', '', $item[3]))); |
|
38 | + $value = abs((float)str_replace(',', '.', str_replace(' ', '', $item[3]))); |
|
39 | 39 | $debit = true; |
40 | 40 | } else { |
41 | - $value = (float) str_replace(',', '.', str_replace(' ', '', $item[4])); |
|
41 | + $value = (float)str_replace(',', '.', str_replace(' ', '', $item[4])); |
|
42 | 42 | $debit = false; |
43 | 43 | } |
44 | 44 |
@@ -22,7 +22,7 @@ |
||
22 | 22 | |
23 | 23 | public function __toString() |
24 | 24 | { |
25 | - return (string) $this->configuration['name']; |
|
25 | + return (string)$this->configuration['name']; |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | public function frenchDateFormatter($raw) |
@@ -26,20 +26,20 @@ |
||
26 | 26 | */ |
27 | 27 | public function format(ArrayCollection $data) |
28 | 28 | { |
29 | - $data = $data->map(function ($item) { |
|
29 | + $data = $data->map(function($item) { |
|
30 | 30 | // Date |
31 | 31 | $dateRaw = $item[2]; |
32 | 32 | $date = new \DateTime(); |
33 | - $date->setDate(2000 + (int) substr($dateRaw, 6, 2), (int) substr($dateRaw, 3, 2), (int) substr($dateRaw, 0, 2)); |
|
33 | + $date->setDate(2000 + (int)substr($dateRaw, 6, 2), (int)substr($dateRaw, 3, 2), (int)substr($dateRaw, 0, 2)); |
|
34 | 34 | $date->setTime(12, 0, 0); |
35 | 35 | // Value |
36 | 36 | $debitRaw = $item[3]; |
37 | 37 | if (strlen($debitRaw)) { |
38 | - $value = abs((float) str_replace(',', '.', str_replace(' ', '', $debitRaw))); |
|
38 | + $value = abs((float)str_replace(',', '.', str_replace(' ', '', $debitRaw))); |
|
39 | 39 | $debit = true; |
40 | 40 | } else { |
41 | 41 | $creditRaw = $item[4]; |
42 | - $value = (float) str_replace(',', '.', str_replace(' ', '', $creditRaw)); |
|
42 | + $value = (float)str_replace(',', '.', str_replace(' ', '', $creditRaw)); |
|
43 | 43 | $debit = false; |
44 | 44 | } |
45 | 45 |
@@ -28,27 +28,27 @@ |
||
28 | 28 | */ |
29 | 29 | public function format(ArrayCollection $data) |
30 | 30 | { |
31 | - $data = $data->map(function ($item) { |
|
31 | + $data = $data->map(function($item) { |
|
32 | 32 | // Date |
33 | 33 | $dateRaw = $item[0]; |
34 | 34 | $date = new \DateTime(); |
35 | - $date->setDate((int) substr($dateRaw, 6, 4), (int) substr($dateRaw, 3, 2), (int) substr($dateRaw, 0, 2)); |
|
35 | + $date->setDate((int)substr($dateRaw, 6, 4), (int)substr($dateRaw, 3, 2), (int)substr($dateRaw, 0, 2)); |
|
36 | 36 | $date->setTime(12, 0, 0); |
37 | 37 | |
38 | 38 | // Value Date |
39 | 39 | $dateRaw = $item[1]; |
40 | 40 | $valueDate = new \DateTime(); |
41 | - $valueDate->setDate((int) substr($dateRaw, 6, 4), (int) substr($dateRaw, 3, 2), (int) substr($dateRaw, 0, 2)); |
|
41 | + $valueDate->setDate((int)substr($dateRaw, 6, 4), (int)substr($dateRaw, 3, 2), (int)substr($dateRaw, 0, 2)); |
|
42 | 42 | $valueDate->setTime(12, 0, 0); |
43 | 43 | |
44 | 44 | // Value |
45 | 45 | $debitRaw = $item[3]; |
46 | 46 | if (strlen($debitRaw)) { |
47 | - $value = abs((float) str_replace(',', '.', str_replace('.', '', $debitRaw))); |
|
47 | + $value = abs((float)str_replace(',', '.', str_replace('.', '', $debitRaw))); |
|
48 | 48 | $debit = true; |
49 | 49 | } else { |
50 | 50 | $creditRaw = $item[4]; |
51 | - $value = (float) str_replace(',', '.', str_replace('.', '', $creditRaw)); |
|
51 | + $value = (float)str_replace(',', '.', str_replace('.', '', $creditRaw)); |
|
52 | 52 | $debit = false; |
53 | 53 | } |
54 | 54 |