Skip to content

Commit 4dc15a0

Browse files
authored
Merge pull request #6 from violet-php/php81
Fix warnings on PHP 8.1
2 parents 89ed24c + 30c0570 commit 4dc15a0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
matrix:
1414
operating-system: [ubuntu-latest]
15-
php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0']
15+
php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
1616
runs-on: ${{ matrix.operating-system }}
1717
steps:
1818
- name: Checkout

src/AbstractJsonEncoder.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ private function initialize()
123123
* Returns the current number of step in the encoder.
124124
* @return int|null The current step number as integer or null if the current state is not valid
125125
*/
126+
#[\ReturnTypeWillChange]
126127
public function key()
127128
{
128129
$this->initialize();
@@ -134,6 +135,7 @@ public function key()
134135
* Tells if the encoder has a valid current state.
135136
* @return bool True if the iterator has a valid state, false if not
136137
*/
138+
#[\ReturnTypeWillChange]
137139
public function valid()
138140
{
139141
$this->initialize();
@@ -145,11 +147,13 @@ public function valid()
145147
* Returns the current value or state from the encoder.
146148
* @return mixed The current value or state from the encoder
147149
*/
150+
#[\ReturnTypeWillChange]
148151
abstract public function current();
149152

150153
/**
151154
* Returns the JSON encoding to the beginning.
152155
*/
156+
#[\ReturnTypeWillChange]
153157
public function rewind()
154158
{
155159
if ($this->step === 0) {
@@ -172,6 +176,7 @@ public function rewind()
172176
/**
173177
* Iterates the next token or tokens to the output stream.
174178
*/
179+
#[\ReturnTypeWillChange]
175180
public function next()
176181
{
177182
$this->initialize();

0 commit comments

Comments
 (0)