From 82a5f6f88bba54e2786baadcfd4d45ac58c76ea3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=BDborn=C3=BD=20Adam?= Date: Tue, 4 Apr 2023 12:40:31 +0200 Subject: [PATCH 1/6] Matrix test for various PHP versions --- .github/workflows/push.yml | 8 +++++++- Dockerfile | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 26855f0..178e47b 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -9,6 +9,10 @@ env: jobs: tests: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php_version: [ 8.2, 8.1, 8.0, 7.4 ] steps: - name: 'Check out the repo' @@ -22,4 +26,6 @@ jobs: run: 'docker build -t $APP_IMAGE .' - name: 'Run tests' - run: 'docker run ${{env.APP_IMAGE}} composer ci' \ No newline at end of file + run: | + export PHP_VERSION="${{ matrix.php_version }}" + docker run ${{env.APP_IMAGE}} composer ci diff --git a/Dockerfile b/Dockerfile index 462ebcb..aa7c5e1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,6 @@ -FROM php:7.4 +ARG PHP_VERSION=7.4 + +FROM php:${PHP_VERSION:-7.4} ARG DEBIAN_FRONTEND=noninteractive ARG COMPOSER_FLAGS="--prefer-dist --no-interaction" From 625acc1bb42175a0668f2372e1266ab9318acf7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=BDborn=C3=BD=20Adam?= Date: Tue, 4 Apr 2023 12:43:03 +0200 Subject: [PATCH 2/6] Fix PHPCS --- tests/CsvWriteTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/CsvWriteTest.php b/tests/CsvWriteTest.php index 6e4c640..c35425c 100644 --- a/tests/CsvWriteTest.php +++ b/tests/CsvWriteTest.php @@ -222,7 +222,7 @@ public function testInvalidPointer() new StringContains( 'Cannot write to CSV file Error: fwrite(): ' . 'Write of 14 bytes failed with errno=9 Bad file descriptor Return: false To write: 14 Written: 0' - ) + ), ]); self::assertThat($e->getMessage(), $or); } From 1a1f7a6d7df01629a828b0972493dff2be6175a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=BDborn=C3=BD=20Adam?= Date: Tue, 4 Apr 2023 12:46:58 +0200 Subject: [PATCH 3/6] Fix matrix --- .github/workflows/push.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 178e47b..09cf27d 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -23,9 +23,7 @@ jobs: run: 'docker login --username "$DOCKERHUB_USER" --password "$DOCKERHUB_TOKEN"' - name: 'Build image' - run: 'docker build -t $APP_IMAGE .' + run: 'docker build --build-arg PHP_VERSION=${{ matrix.php_version }} -t $APP_IMAGE .' - name: 'Run tests' - run: | - export PHP_VERSION="${{ matrix.php_version }}" - docker run ${{env.APP_IMAGE}} composer ci + run: 'docker run ${{env.APP_IMAGE}} composer ci' From c9f72cd715198ed1ee6aa3340bbc7d5e4075f9fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=BDborn=C3=BD=20Adam?= Date: Tue, 4 Apr 2023 13:02:11 +0200 Subject: [PATCH 4/6] Create PHPStan baseline for PHP 8+ --- ignore-by-php-version.neon.php | 18 ++ phpstan-baseline-8+.neon | 496 +++++++++++++++++++++++++++++++++ phpstan.neon | 2 +- 3 files changed, 515 insertions(+), 1 deletion(-) create mode 100644 ignore-by-php-version.neon.php create mode 100644 phpstan-baseline-8+.neon diff --git a/ignore-by-php-version.neon.php b/ignore-by-php-version.neon.php new file mode 100644 index 0000000..8a26db4 --- /dev/null +++ b/ignore-by-php-version.neon.php @@ -0,0 +1,18 @@ += 80000) { + $config = array_merge_recursive($config, $adapter->load(__DIR__ . '/phpstan-baseline-8+.neon')); +} else { + $config = array_merge_recursive($config, $adapter->load(__DIR__ . '/phpstan-baseline.neon')); +} + +$config['parameters']['phpVersion'] = PHP_VERSION_ID; + +return $config; diff --git a/phpstan-baseline-8+.neon b/phpstan-baseline-8+.neon new file mode 100644 index 0000000..45a2f3a --- /dev/null +++ b/phpstan-baseline-8+.neon @@ -0,0 +1,496 @@ +parameters: + ignoreErrors: + - + message: "#^Method Keboola\\\\Csv\\\\AbstractCsvFile\\:\\:closeFile\\(\\) has no return type specified\\.$#" + count: 1 + path: src/AbstractCsvFile.php + + - + message: "#^Method Keboola\\\\Csv\\\\AbstractCsvFile\\:\\:openCsvFile\\(\\) has no return type specified\\.$#" + count: 1 + path: src/AbstractCsvFile.php + + - + message: "#^Method Keboola\\\\Csv\\\\AbstractCsvFile\\:\\:openCsvFile\\(\\) has parameter \\$fileName with no type specified\\.$#" + count: 1 + path: src/AbstractCsvFile.php + + - + message: "#^Method Keboola\\\\Csv\\\\AbstractCsvFile\\:\\:setFile\\(\\) has no return type specified\\.$#" + count: 1 + path: src/AbstractCsvFile.php + + - + message: "#^Method Keboola\\\\Csv\\\\CsvOptions\\:\\:validateDelimiter\\(\\) has no return type specified\\.$#" + count: 1 + path: src/CsvOptions.php + + - + message: "#^Method Keboola\\\\Csv\\\\CsvOptions\\:\\:validateEnclosure\\(\\) has no return type specified\\.$#" + count: 1 + path: src/CsvOptions.php + + - + message: "#^Class Keboola\\\\Csv\\\\CsvReader implements generic interface Iterator but does not specify its types\\: TKey, TValue$#" + count: 1 + path: src/CsvReader.php + + - + message: "#^Method Keboola\\\\Csv\\\\CsvReader\\:\\:getHeader\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/CsvReader.php + + - + message: "#^Method Keboola\\\\Csv\\\\CsvReader\\:\\:openCsvFile\\(\\) has no return type specified\\.$#" + count: 1 + path: src/CsvReader.php + + - + message: "#^Method Keboola\\\\Csv\\\\CsvReader\\:\\:openCsvFile\\(\\) has parameter \\$fileName with no type specified\\.$#" + count: 1 + path: src/CsvReader.php + + - + message: "#^Method Keboola\\\\Csv\\\\CsvReader\\:\\:readLine\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/CsvReader.php + + - + message: "#^Method Keboola\\\\Csv\\\\CsvReader\\:\\:validateSkipLines\\(\\) has no return type specified\\.$#" + count: 1 + path: src/CsvReader.php + + - + message: "#^Offset 'message' does not exist on array\\{type\\: int, message\\: string, file\\: string, line\\: int\\}\\|null\\.$#" + count: 1 + path: src/CsvReader.php + + - + message: "#^Parameter \\#1 \\$header of static method Keboola\\\\Csv\\\\UTF8BOMHelper\\:\\:detectAndRemoveBOM\\(\\) expects array, array\\|false\\|null given\\.$#" + count: 1 + path: src/CsvReader.php + + - + message: "#^Parameter \\#1 \\$sample of static method Keboola\\\\Csv\\\\LineBreaksHelper\\:\\:detectLineBreaks\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: src/CsvReader.php + + - + message: "#^Parameter \\#1 \\$string of function trim expects string, string\\|false given\\.$#" + count: 1 + path: src/CsvReader.php + + - + message: "#^Property Keboola\\\\Csv\\\\AbstractCsvFile\\:\\:\\$filePointer \\(resource\\) does not accept resource\\|false\\.$#" + count: 1 + path: src/CsvReader.php + + - + message: "#^Property Keboola\\\\Csv\\\\CsvReader\\:\\:\\$currentRow type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/CsvReader.php + + - + message: "#^Property Keboola\\\\Csv\\\\CsvReader\\:\\:\\$header type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/CsvReader.php + + - + message: "#^Method Keboola\\\\Csv\\\\CsvWriter\\:\\:openCsvFile\\(\\) has no return type specified\\.$#" + count: 1 + path: src/CsvWriter.php + + - + message: "#^Method Keboola\\\\Csv\\\\CsvWriter\\:\\:rowToStr\\(\\) has parameter \\$row with no value type specified in iterable type array\\.$#" + count: 1 + path: src/CsvWriter.php + + - + message: "#^Method Keboola\\\\Csv\\\\CsvWriter\\:\\:setLineBreak\\(\\) has no return type specified\\.$#" + count: 1 + path: src/CsvWriter.php + + - + message: "#^Method Keboola\\\\Csv\\\\CsvWriter\\:\\:validateLineBreak\\(\\) has no return type specified\\.$#" + count: 1 + path: src/CsvWriter.php + + - + message: "#^Method Keboola\\\\Csv\\\\CsvWriter\\:\\:writeRow\\(\\) has no return type specified\\.$#" + count: 1 + path: src/CsvWriter.php + + - + message: "#^Method Keboola\\\\Csv\\\\CsvWriter\\:\\:writeRow\\(\\) has parameter \\$row with no value type specified in iterable type array\\.$#" + count: 1 + path: src/CsvWriter.php + + - + message: "#^Offset 'message' does not exist on array\\{type\\: int, message\\: string, file\\: string, line\\: int\\}\\|null\\.$#" + count: 1 + path: src/CsvWriter.php + + - + message: "#^Parameter \\#3 \\$subject of function str_replace expects array\\|string, bool\\|float\\|int\\|object\\|string given\\.$#" + count: 1 + path: src/CsvWriter.php + + - + message: "#^Property Keboola\\\\Csv\\\\AbstractCsvFile\\:\\:\\$filePointer \\(resource\\) does not accept resource\\|false\\.$#" + count: 1 + path: src/CsvWriter.php + + - + message: "#^Method Keboola\\\\Csv\\\\LineBreaksHelper\\:\\:clearCsvValues\\(\\) should return string but returns string\\|null\\.$#" + count: 1 + path: src/LineBreaksHelper.php + + - + message: "#^Method Keboola\\\\Csv\\\\UTF8BOMHelper\\:\\:detectAndRemoveBOM\\(\\) has parameter \\$header with no value type specified in iterable type array\\.$#" + count: 1 + path: src/UTF8BOMHelper.php + + - + message: "#^Method Keboola\\\\Csv\\\\UTF8BOMHelper\\:\\:detectAndRemoveBOM\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/UTF8BOMHelper.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvOptionsTest\\:\\:testAccessors\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvOptionsTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvOptionsTest\\:\\:testInvalidDelimiter\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvOptionsTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvOptionsTest\\:\\:testInvalidDelimiterEmpty\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvOptionsTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvOptionsTest\\:\\:testInvalidEnclosure\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvOptionsTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:bomProvider\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:getPerformanceTestInputs\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:invalidDelimiterProvider\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:invalidEnclosureProvider\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:invalidSkipLinesProvider\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:testAccessors\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:testColumnsCount\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:testException\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:testExistingFileShouldBeCreated\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:testHeaderNoRewindOnGetHeader\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:testInitInvalidFileShouldThrowException\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:testInvalidDelimiter\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:testInvalidEnclosureShouldThrowException\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:testInvalidFile\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:testInvalidLineBreak\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:testInvalidPointer\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:testInvalidSkipLines\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:testIterator\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:testLineBreakWithoutRewind\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:testLineEndingsDetection\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:testParse\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:testParseEscapedBy\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:testParseMacLineEndsInField\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:testPerformance\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:testRead\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:testReadPointer\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:testSkipNoLines\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:testSkipsHeaders\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:testSkipsMultipleLines\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:testSkipsOverflow\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:testUtf8BOM\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:testUtf8BOM\\(\\) has parameter \\$bomFile with no type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:testValidWithoutRewind\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:testWriteReadInTheMiddle\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:validCsvFiles\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvReadTest\\:\\:validLineBreaksData\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Parameter \\#1 \\$file of class Keboola\\\\Csv\\\\CsvReader constructor expects resource\\|string, array\\ given\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Parameter \\#1 \\$file of class Keboola\\\\Csv\\\\CsvReader constructor expects resource\\|string, resource\\|false given\\.$#" + count: 2 + path: tests/CsvReadTest.php + + - + message: "#^Parameter \\#1 \\$stream of function fread expects resource, resource\\|false given\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Parameter \\#1 \\$stream of function rewind expects resource, resource\\|false given\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Parameter \\#5 \\$skipLines of class Keboola\\\\Csv\\\\CsvReader constructor expects int, mixed given\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Unreachable statement \\- code above always terminates\\.$#" + count: 1 + path: tests/CsvReadTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvWriteTest\\:\\:invalidFileNameProvider\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvWriteTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvWriteTest\\:\\:testAccessors\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvWriteTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvWriteTest\\:\\:testInvalidFile\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvWriteTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvWriteTest\\:\\:testInvalidFileName\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvWriteTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvWriteTest\\:\\:testInvalidPointer\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvWriteTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvWriteTest\\:\\:testInvalidPointer2\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvWriteTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvWriteTest\\:\\:testNewFileShouldBeCreated\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvWriteTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvWriteTest\\:\\:testNonStringWrite\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvWriteTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvWriteTest\\:\\:testWrite\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvWriteTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvWriteTest\\:\\:testWriteInvalidObject\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvWriteTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvWriteTest\\:\\:testWriteLineBreak\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvWriteTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvWriteTest\\:\\:testWritePointer\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvWriteTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\CsvWriteTest\\:\\:testWriteValidObject\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/CsvWriteTest.php + + - + message: "#^Parameter \\#1 \\$file of class Keboola\\\\Csv\\\\CsvWriter constructor expects resource\\|string, array\\ given\\.$#" + count: 1 + path: tests/CsvWriteTest.php + + - + message: "#^Parameter \\#1 \\$file of class Keboola\\\\Csv\\\\CsvWriter constructor expects resource\\|string, resource\\|false given\\.$#" + count: 3 + path: tests/CsvWriteTest.php + + - + message: "#^Parameter \\#1 \\$stream of function fclose expects resource, resource\\|false given\\.$#" + count: 1 + path: tests/CsvWriteTest.php + + - + message: "#^Parameter \\#1 \\$stream of function fwrite expects resource, resource\\|false given\\.$#" + count: 1 + path: tests/CsvWriteTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\LineBreaksHelperTest\\:\\:getDataSet\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/LineBreaksHelperTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\LineBreaksHelperTest\\:\\:testLineBreaksDetection\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/LineBreaksHelperTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\UTF8BOMHelperTest\\:\\:bomProvider\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/UTF8BOMHelperTest.php + + - + message: "#^Method Keboola\\\\Csv\\\\Tests\\\\UTF8BOMHelperTest\\:\\:testDetectAndRemoveBOM\\(\\) has no return type specified\\.$#" + count: 1 + path: tests/UTF8BOMHelperTest.php + + - + message: "#^Parameter \\#1 \\$header of static method Keboola\\\\Csv\\\\UTF8BOMHelper\\:\\:detectAndRemoveBOM\\(\\) expects array, mixed given\\.$#" + count: 1 + path: tests/UTF8BOMHelperTest.php diff --git a/phpstan.neon b/phpstan.neon index 2ee6a55..d1a1e72 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,2 +1,2 @@ includes: - - phpstan-baseline.neon + - ignore-by-php-version.neon.php From 9e47595f6dec71cf6c007879ea1f3d17538260cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=BDborn=C3=BD=20Adam?= Date: Tue, 4 Apr 2023 13:14:14 +0200 Subject: [PATCH 5/6] Set maximum PHPUnit version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ee47623..306ac93 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ "keboola/coding-standard": "^13.0", "php-parallel-lint/php-parallel-lint": "^1.3", "phpstan/phpstan": "^1.4", - "phpunit/phpunit": ">=7.5", + "phpunit/phpunit": ">=7.5 <=9.6", "phpstan/phpdoc-parser": "1.5.*" }, "scripts": { From f2ed7d98d1097d51d6e3fd8c0cae2b81f6fbd4db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=BDborn=C3=BD=20Adam?= Date: Wed, 5 Apr 2023 10:26:12 +0200 Subject: [PATCH 6/6] Updated version of actions/checkout --- .github/workflows/push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 09cf27d..47a71be 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -16,7 +16,7 @@ jobs: steps: - name: 'Check out the repo' - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: 'Docker login' if: env.DOCKERHUB_TOKEN