Repository navigation
Add a native return type to offsetGet() - #106
Merged
Merged
Conversation
GrahamCampbell
force-pushed
the
add-offsetget-return-type-3.0
branch
from
November 20, 2026 16:51
d4eb9e0 to
f2f6af8
Compare
GrahamCampbell
marked this pull request as ready for review
November 20, 2026 17:18
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HasDataTrait::offsetGet(), whichCommandandResultuse, was the only method left on this branch that carried#[\ReturnTypeWillChange]instead of a return type, because PHP 7.4 has nomixedtype. With PHP 8.0 as the minimum it now declaresmixedand the attribute is removed.This is a deliberate break for the major release. A class that extends
Command,Result, or any other class that takesoffsetGet()from the trait, and overrides it without a return type, no longer loads, and putting the attribute on the override does not change that, so the 3.0 upgrade guide says what such classes need. Custom implementations ofCommandInterfaceandResultInterfacethat do not use the trait are not affected.