Skip to content

Commit

Permalink
Merge pull request #6 from violet-php/php81
Browse files Browse the repository at this point in the history
Fix warnings on PHP 8.1
  • Loading branch information
Riimu committed Dec 27, 2021
2 parents 89ed24c + 30c0570 commit 4dc15a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0']
php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
runs-on: ${{ matrix.operating-system }}
steps:
- name: Checkout
Expand Down
5 changes: 5 additions & 0 deletions src/AbstractJsonEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ private function initialize()
* Returns the current number of step in the encoder.
* @return int|null The current step number as integer or null if the current state is not valid
*/
#[\ReturnTypeWillChange]
public function key()
{
$this->initialize();
Expand All @@ -134,6 +135,7 @@ public function key()
* Tells if the encoder has a valid current state.
* @return bool True if the iterator has a valid state, false if not
*/
#[\ReturnTypeWillChange]
public function valid()
{
$this->initialize();
Expand All @@ -145,11 +147,13 @@ public function valid()
* Returns the current value or state from the encoder.
* @return mixed The current value or state from the encoder
*/
#[\ReturnTypeWillChange]
abstract public function current();

/**
* Returns the JSON encoding to the beginning.
*/
#[\ReturnTypeWillChange]
public function rewind()
{
if ($this->step === 0) {
Expand All @@ -172,6 +176,7 @@ public function rewind()
/**
* Iterates the next token or tokens to the output stream.
*/
#[\ReturnTypeWillChange]
public function next()
{
$this->initialize();
Expand Down

0 comments on commit 4dc15a0

Please sign in to comment.