From 6a523f257883a8f06e887a96c18b449dbc1223e3 Mon Sep 17 00:00:00 2001 From: Ondra Date: Tue, 14 Nov 2023 15:58:04 +0100 Subject: [PATCH] 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;