Skip to content

Commit b184687

Browse files
authored
Remove Deprecated for PHP 8.1
Add PHP Attribute `ReturnTypeWillChange` on ErrorContainer::next and ErrorContainer::rewind to temporarily suppress the deprecation notices: - `Deprecated: Return type of Opis\JsonSchema\Errors\ErrorContainer::next(): ?Opis\JsonSchema\Errors\ValidationError should either be compatible with Iterator::next(): void` - `Deprecated: Return type of Opis\JsonSchema\Errors\ErrorContainer::rewind(): ?Opis\JsonSchema\Errors\ValidationError should either be compatible with Iterator::rewind(): void`.
1 parent 1cec9a5 commit b184687

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Errors/ErrorContainer.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ public function current(): ?ValidationError
115115
/**
116116
* @inheritDoc
117117
*/
118+
#[\ReturnTypeWillChange]
118119
public function next(): ?ValidationError
119120
{
120121
return next($this->errors) ?: null;
@@ -139,8 +140,9 @@ public function valid(): bool
139140
/**
140141
* @inheritDoc
141142
*/
143+
#[\ReturnTypeWillChange]
142144
public function rewind(): ?ValidationError
143145
{
144146
return reset($this->errors) ?: null;
145147
}
146-
}
148+
}

0 commit comments

Comments
 (0)