From c3e2df0d0ce173739e6a0160a5126dba1b145e22 Mon Sep 17 00:00:00 2001 From: Guillaume Seznec <767901+aerogus@users.noreply.github.com> Date: Thu, 3 Nov 2022 16:16:10 +0100 Subject: [PATCH] Add annotations to remove deprecated warning message on php8.1 (#152) Co-authored-by: Guillaume Seznec --- lib/cli/arguments/Lexer.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/cli/arguments/Lexer.php b/lib/cli/arguments/Lexer.php index f6012ef..a5a4767 100644 --- a/lib/cli/arguments/Lexer.php +++ b/lib/cli/arguments/Lexer.php @@ -33,6 +33,7 @@ public function __construct(array $items) { * * @return string */ + #[\ReturnTypeWillChange] public function current() { return $this->_item; } @@ -49,6 +50,7 @@ public function peek() { /** * Move the cursor forward 1 element if it is valid. */ + #[\ReturnTypeWillChange] public function next() { if ($this->valid()) { $this->_shift(); @@ -60,6 +62,7 @@ public function next() { * * @return int */ + #[\ReturnTypeWillChange] public function key() { return $this->_index; } @@ -68,6 +71,7 @@ public function key() { * Move forward 1 element and, if the method hasn't been called before, reset * the cursor's position to 0. */ + #[\ReturnTypeWillChange] public function rewind() { $this->_shift(); if ($this->_first) { @@ -81,6 +85,7 @@ public function rewind() { * * @return bool */ + #[\ReturnTypeWillChange] public function valid() { return ($this->_index < $this->_length); }