json-schema
json-schema copied to clipboard
Fix ObjectIterator for PHP8
Hi, with PHP8.1 the iterator methods of ObjectIterator must be covariant with the PHP core interfaces.
I didn't know if theres a specific return type for ::current
, so I went with the suppress annotation here. Happy to change this to a return type, if there is one?
Deprecated: Return type of JsonSchema\Iterator\ObjectIterator::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in [...]/vendor/justinrainbow/json-schema/src/JsonSchema/Iterator/ObjectIterator.php on line 42
Deprecated: Return type of JsonSchema\Iterator\ObjectIterator::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in [...]/vendor/justinrainbow/json-schema/src/JsonSchema/Iterator/ObjectIterator.php on line 52
Deprecated: Return type of JsonSchema\Iterator\ObjectIterator::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in [...]/vendor/justinrainbow/json-schema/src/JsonSchema/Iterator/ObjectIterator.php on line 61
Deprecated: Return type of JsonSchema\Iterator\ObjectIterator::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in [...]/vendor/justinrainbow/json-schema/src/JsonSchema/Iterator/ObjectIterator.php on line 71
Deprecated: Return type of JsonSchema\Iterator\ObjectIterator::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in [...]/vendor/justinrainbow/json-schema/src/JsonSchema/Iterator/ObjectIterator.php on line 81
Deprecated: Return type of JsonSchema\Iterator\ObjectIterator::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in [...]/vendor/justinrainbow/json-schema/src/JsonSchema/Iterator/ObjectIterator.php on line 90
Thanks but given the min php version is still 5.3.3 on this repo, it'd probably be more appropriate to mark all methods with #[ReturnTypeWillChange]
@R4c00n #689
See #726 for the topic of raising the minimum PHP level and supporting newer versions PHP.
Any chance of this making it into the next 5.x release? Adding #[ReturnTypeWillChange]
should be enough for now and it would still be compatible with PHP 5.3.
Any chance of this making it into the next 5.x release? Adding
#[ReturnTypeWillChange]
should be enough for now and it would still be compatible with PHP 5.3.
We are working on bringing the project back alive, you can see more in the discussions. We are however not planning to do anything with the 5.x
branch but only focus on the upcoming 6.x
and forward. Secondly in it's current state this PR would break the support of older PHP versions which is still part of the 5.x
branch.
This PR was ported in #746 which address the raising on the minimum version PHP as a whole including pipelines. Closing this PR for now