Skip to content

Commit

Permalink
Merge pull request #32 from DivanteLtd/feature/fix-for-multiline-fields
Browse files Browse the repository at this point in the history
fix-for-multiline-fields
  • Loading branch information
sigere authored Mar 24, 2022
2 parents 204a0e0 + d8cb667 commit 5c6752e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ jobs:
- name: PHP Copy/Paste Detector
run: |
composer global require "sebastian/phpcpd":"^4.1" \
composer global require "sebastian/phpcpd":"^6.0" \
--no-interaction --prefer-dist --ignore-platform-reqs --quiet
/home/runner/.composer/vendor/bin/phpcpd src
- name: PHP DocBlock Checker
run: |
composer global require "block8/php-docblock-checker":"^1.10" \
composer global require "divante-ltd/php-docblock-checker" \
--no-interaction --prefer-dist --ignore-platform-reqs --quiet
/home/runner/.composer/vendor/bin/phpdoccheck --directory=src
17 changes: 7 additions & 10 deletions src/ScheduledExportBundle/Export/Export.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public function getExportRegistry() : ScheduledExportRegistry
$exportRegistry->setGridConfigId($adaptedGridConfigId);
$exportRegistry->save();
}

return $exportRegistry;
}

Expand Down Expand Up @@ -427,18 +427,15 @@ protected function saveFileInAssets(array $filenames): void
}

if ($this->input->getOption('divide_file')) {
$line = strtok($content, $separator);
$header = $line;
$rows = explode($separator, $content);
$header = array_shift($rows);

$counter = 0;
$fileCounter = 0;
$subContent = "";
while ($line !== false) {
$line = strtok($separator);
if ($line !== false) {
$subContent .= $line . "\r\n";
}
$counter++;
if ($counter % $this->input->getOption('divide_file') == 0) {
foreach ($rows as $row) {
$subContent .= $row . "\r\n";
if (++$counter % $this->input->getOption('divide_file') == 0) {
$this->saveAsset($assetFolder, $fileCounter, $header, $subContent);
$subContent = "";
$fileCounter++;
Expand Down

0 comments on commit 5c6752e

Please sign in to comment.