-
Notifications
You must be signed in to change notification settings - Fork 471
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix remaining Hoa PHP 8.1 deprecations
- Loading branch information
1 parent
7367c7b
commit 458a8fb
Showing
3 changed files
with
158 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
@package hoa/iterator | ||
|
||
--- Buffer.php 2017-01-10 11:34:47.000000000 +0100 | ||
+++ Buffer.php 2021-10-30 16:36:22.000000000 +0200 | ||
@@ -103,7 +103,7 @@ | ||
* | ||
* @return \Iterator | ||
*/ | ||
- public function getInnerIterator() | ||
+ public function getInnerIterator(): ?\Iterator | ||
{ | ||
return $this->_iterator; | ||
} | ||
@@ -133,6 +133,7 @@ | ||
* | ||
* @return mixed | ||
*/ | ||
+ #[\ReturnTypeWillChange] | ||
public function current() | ||
{ | ||
return $this->getBuffer()->current()[self::BUFFER_VALUE]; | ||
@@ -143,6 +144,7 @@ | ||
* | ||
* @return mixed | ||
*/ | ||
+ #[\ReturnTypeWillChange] | ||
public function key() | ||
{ | ||
return $this->getBuffer()->current()[self::BUFFER_KEY]; | ||
@@ -153,7 +155,7 @@ | ||
* | ||
* @return void | ||
*/ | ||
- public function next() | ||
+ public function next(): void | ||
{ | ||
$innerIterator = $this->getInnerIterator(); | ||
$buffer = $this->getBuffer(); | ||
@@ -204,7 +206,7 @@ | ||
* | ||
* @return void | ||
*/ | ||
- public function rewind() | ||
+ public function rewind(): void | ||
{ | ||
$innerIterator = $this->getInnerIterator(); | ||
$buffer = $this->getBuffer(); | ||
@@ -228,7 +230,7 @@ | ||
* | ||
* @return bool | ||
*/ | ||
- public function valid() | ||
+ public function valid(): bool | ||
{ | ||
return | ||
$this->getBuffer()->valid() && |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
@package hoa/iterator | ||
|
||
--- Lookahead.php 2017-01-10 11:34:47.000000000 +0100 | ||
+++ Lookahead.php 2021-10-30 16:35:30.000000000 +0200 | ||
@@ -93,7 +93,7 @@ | ||
* | ||
* @return \Iterator | ||
*/ | ||
- public function getInnerIterator() | ||
+ public function getInnerIterator(): ?\Iterator | ||
{ | ||
return $this->_iterator; | ||
} | ||
@@ -103,6 +103,7 @@ | ||
* | ||
* @return mixed | ||
*/ | ||
+ #[\ReturnTypeWillChange] | ||
public function current() | ||
{ | ||
return $this->_current; | ||
@@ -113,6 +114,7 @@ | ||
* | ||
* @return mixed | ||
*/ | ||
+ #[\ReturnTypeWillChange] | ||
public function key() | ||
{ | ||
return $this->_key; | ||
@@ -123,6 +125,7 @@ | ||
* | ||
* @return void | ||
*/ | ||
+ #[\ReturnTypeWillChange] | ||
public function next() | ||
{ | ||
$innerIterator = $this->getInnerIterator(); | ||
@@ -143,6 +146,7 @@ | ||
* | ||
* @return void | ||
*/ | ||
+ #[\ReturnTypeWillChange] | ||
public function rewind() | ||
{ | ||
$out = $this->getInnerIterator()->rewind(); | ||
@@ -156,7 +160,7 @@ | ||
* | ||
* @return bool | ||
*/ | ||
- public function valid() | ||
+ public function valid(): bool | ||
{ | ||
return $this->_valid; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
@package hoa/protocol | ||
|
||
--- Node/Node.php 2017-01-14 13:26:10.000000000 +0100 | ||
+++ Node/Node.php 2021-10-30 16:32:43.000000000 +0200 | ||
@@ -108,7 +108,7 @@ | ||
* @return \Hoa\Protocol\Protocol | ||
* @throws \Hoa\Protocol\Exception | ||
*/ | ||
- public function offsetSet($name, $node) | ||
+ public function offsetSet($name, $node): void | ||
{ | ||
if (!($node instanceof self)) { | ||
throw new Protocol\Exception( | ||
@@ -141,6 +141,7 @@ | ||
* @return \Hoa\Protocol\Protocol | ||
* @throws \Hoa\Protocol\Exception | ||
*/ | ||
+ #[\ReturnTypeWillChange] | ||
public function offsetGet($name) | ||
{ | ||
if (!isset($this[$name])) { | ||
@@ -160,7 +161,7 @@ | ||
* @param string $name Node's name. | ||
* @return bool | ||
*/ | ||
- public function offsetExists($name) | ||
+ public function offsetExists($name): bool | ||
{ | ||
return true === array_key_exists($name, $this->_children); | ||
} | ||
@@ -171,7 +172,7 @@ | ||
* @param string $name Node's name to remove. | ||
* @return void | ||
*/ | ||
- public function offsetUnset($name) | ||
+ public function offsetUnset($name): void | ||
{ | ||
unset($this->_children[$name]); | ||
|
||
@@ -365,7 +366,7 @@ | ||
* | ||
* @return \ArrayIterator | ||
*/ | ||
- public function getIterator() | ||
+ public function getIterator(): \Traversable | ||
{ | ||
return new \ArrayIterator($this->_children); | ||
} |