From 95b9a8a9fd5ebf528e0bc3ba186a4bb554e6eab0 Mon Sep 17 00:00:00 2001 From: Ben Thomson Date: Mon, 24 Jun 2019 13:47:47 +0800 Subject: [PATCH] Fix Travis CI file scope (#4408) Original PR (#4394) was picking up changes from other branches as well as from `master`. This change should limit the scope of files to just the changed files in this PR. --- .travis.yml | 6 ++++-- modules/backend/models/ExportModel.php | 5 ++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index d1184faba..1339ea7a1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,8 +44,10 @@ jobs: - stage: code quality if: type = pull_request php: 7.1 - script: ./vendor/bin/phpcs --colors -nq --report="full" --extensions="php" $(git diff-tree --no-commit-id --name-only -r ${TRAVIS_COMMIT_RANGE/.../..}) + script: + - git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" && git fetch + - ./vendor/bin/phpcs --colors -nq --report="full" --extensions="php" $(git diff --name-only HEAD origin/$TRAVIS_BRANCH) - stage: code quality if: type = push AND (branch = develop OR branch = master) php: 7.1 - script: ./vendor/bin/phpcs --colors -nq --report="full" --extensions="php" $(git diff-tree --no-commit-id --name-only -r $TRAVIS_COMMIT) + script: ./vendor/bin/phpcs --colors -nq --report="full" --extensions="php" $(git diff --name-only $TRAVIS_COMMIT) diff --git a/modules/backend/models/ExportModel.php b/modules/backend/models/ExportModel.php index e899d944f..e0ec00e3c 100644 --- a/modules/backend/models/ExportModel.php +++ b/modules/backend/models/ExportModel.php @@ -96,7 +96,7 @@ abstract class ExportModel extends Model * Prepare CSV */ $csv = CsvWriter::createFromFileObject(new SplTempFileObject); - + $csv->setOutputBOM(CsvWriter::BOM_UTF8); if ($options['delimiter'] !== null) { @@ -193,8 +193,7 @@ abstract class ExportModel extends Model foreach ($data as $value) { if (is_array($value)) { $newData[] = 'Array'; - } - else { + } else { $newData[] = str_replace($delimeter, '\\'.$delimeter, $value); } }