From 220c5ea593b7734f5134c8cd0f411097f8e798da Mon Sep 17 00:00:00 2001 From: Niels Vanpachtenbeke <10651054+Nielsvanpach@users.noreply.github.com> Date: Mon, 6 Dec 2021 16:25:07 +0100 Subject: [PATCH 1/2] add typehinting and ReturnTypeWillChange attributes --- src/DataTransferObjectCollection.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/DataTransferObjectCollection.php b/src/DataTransferObjectCollection.php index 889e0d90..b0725000 100644 --- a/src/DataTransferObjectCollection.php +++ b/src/DataTransferObjectCollection.php @@ -29,17 +29,19 @@ public function __get($name) } } + #[\ReturnTypeWillChange] public function current() { return $this->iterator->current(); } + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->iterator[$offset] ?? null; } - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->iterator[] = $value; @@ -53,16 +55,17 @@ public function offsetExists($offset): bool return $this->iterator->offsetExists($offset); } - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->iterator[$offset]); } - public function next() + public function next(): void { $this->iterator->next(); } + #[\ReturnTypeWillChange] public function key() { return $this->iterator->key(); @@ -73,7 +76,7 @@ public function valid(): bool return $this->iterator->valid(); } - public function rewind() + public function rewind(): void { $this->iterator->rewind(); } From f7831eb457fe5d15462bbe4b9043363a631cc4e3 Mon Sep 17 00:00:00 2001 From: Niels Vanpachtenbeke <10651054+Nielsvanpach@users.noreply.github.com> Date: Mon, 6 Dec 2021 16:27:16 +0100 Subject: [PATCH 2/2] run on 8.1 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9c84c2b2..690ade7c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest] - php: [8.0, 7.4] + php: [8.1, 8.0, 7.4] dependency-version: [prefer-lowest, prefer-stable] name: PHP ${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}