From 20674b89537080c2257fa69fe766ea7d5d1721cb Mon Sep 17 00:00:00 2001 From: Danny van Kooten Date: Thu, 8 Dec 2022 11:11:32 +0100 Subject: [PATCH] address PHP8.x warnings about return type this requires PHP 7.1 for the void return type, but only for running the test suite. --- tests/AltoRouterTest.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/AltoRouterTest.php b/tests/AltoRouterTest.php index f4b54ce..86aa6fe 100644 --- a/tests/AltoRouterTest.php +++ b/tests/AltoRouterTest.php @@ -25,23 +25,26 @@ class SimpleTraversable implements Iterator ['POST', '/bar', 'bar_action', 'second_route'] ]; + #[\ReturnTypeWillChange] public function current() { return $this->_data[$this->_position]; } + + #[\ReturnTypeWillChange] public function key() { return $this->_position; } - public function next() + public function next() : void { ++$this->_position; } - public function rewind() + public function rewind() : void { $this->_position = 0; } - public function valid() + public function valid() : bool { return isset($this->_data[$this->_position]); }