From 6a523f257883a8f06e887a96c18b449dbc1223e3 Mon Sep 17 00:00:00 2001 From: Ondra Date: Tue, 14 Nov 2023 15:58:04 +0100 Subject: [PATCH 1/3] support php8 --- .github/workflows/push.yml | 9 ++++++++- Dockerfile | 3 ++- src/CsvReader.php | 5 +++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 26855f0..2ba2423 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -9,6 +9,13 @@ env: jobs: tests: runs-on: ubuntu-latest + strategy: + matrix: + php: + - '5.6' + - '7.4' + - '8.0' + - '8.1' steps: - name: 'Check out the repo' @@ -19,7 +26,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}}" -t $APP_IMAGE .' - name: 'Run tests' run: 'docker run ${{env.APP_IMAGE}} composer ci' \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 462ebcb..d01a6d5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ -FROM php:7.4 +ARG PHP_VERSION=1.21 +FROM php:${PHP_VERSION} ARG DEBIAN_FRONTEND=noninteractive ARG COMPOSER_FLAGS="--prefer-dist --no-interaction" diff --git a/src/CsvReader.php b/src/CsvReader.php index de343f0..3b89649 100644 --- a/src/CsvReader.php +++ b/src/CsvReader.php @@ -169,6 +169,7 @@ public function getLineBreak() /** * @inheritdoc */ + #[\ReturnTypeWillChange] public function rewind() { rewind($this->getFilePointer()); @@ -217,6 +218,7 @@ public function getLineBreakAsText() /** * @inheritdoc */ + #[\ReturnTypeWillChange] public function current() { return $this->currentRow; @@ -225,6 +227,7 @@ public function current() /** * @inheritdoc */ + #[\ReturnTypeWillChange] public function next() { $this->currentRow = $this->readLine(); @@ -234,6 +237,7 @@ public function next() /** * @inheritdoc */ + #[\ReturnTypeWillChange] public function key() { return $this->rowCounter; @@ -242,6 +246,7 @@ public function key() /** * @inheritdoc */ + #[\ReturnTypeWillChange] public function valid() { return $this->currentRow !== false; From 7ba1374719c6de5bd325a787cccd82074856ee39 Mon Sep 17 00:00:00 2001 From: Ondra Date: Tue, 14 Nov 2023 16:01:29 +0100 Subject: [PATCH 2/3] support php8 --- .github/workflows/push.yml | 1 - Dockerfile | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 2ba2423..982d61d 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -12,7 +12,6 @@ jobs: strategy: matrix: php: - - '5.6' - '7.4' - '8.0' - '8.1' diff --git a/Dockerfile b/Dockerfile index d01a6d5..d1a199e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG PHP_VERSION=1.21 +ARG PHP_VERSION=8.2 FROM php:${PHP_VERSION} ARG DEBIAN_FRONTEND=noninteractive From 5a686d68e186b65ba8a69468b55e360e02f63ea0 Mon Sep 17 00:00:00 2001 From: Ondra Date: Tue, 14 Nov 2023 16:02:04 +0100 Subject: [PATCH 3/3] support php8 --- src/CsvReader.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/CsvReader.php b/src/CsvReader.php index 3b89649..40e42ee 100644 --- a/src/CsvReader.php +++ b/src/CsvReader.php @@ -5,6 +5,7 @@ namespace Keboola\Csv; use Iterator; +use ReturnTypeWillChange; class CsvReader extends AbstractCsvFile implements Iterator { @@ -169,7 +170,7 @@ public function getLineBreak() /** * @inheritdoc */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function rewind() { rewind($this->getFilePointer()); @@ -218,7 +219,7 @@ public function getLineBreakAsText() /** * @inheritdoc */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function current() { return $this->currentRow; @@ -227,7 +228,7 @@ public function current() /** * @inheritdoc */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function next() { $this->currentRow = $this->readLine(); @@ -237,7 +238,7 @@ public function next() /** * @inheritdoc */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function key() { return $this->rowCounter; @@ -246,7 +247,7 @@ public function key() /** * @inheritdoc */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function valid() { return $this->currentRow !== false;