Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ReturnTypeWillChange attribute for offsetGet to suppress notice #1607

Merged
merged 1 commit into from
Oct 20, 2024

Conversation

westonruter
Copy link
Member

I noticed a deprecation warning after #1585:

Return type of OD_Element::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

This adds #[ReturnTypeWillChange] attribute as suggested.

This is also used in core, for example: https://github.com/WordPress/wordpress-develop/blob/de51a4412dc3fa4d2591c59492fa76227cdddd29/src/wp-includes/class-wp-block-list.php#L81-L92

@westonruter westonruter added [Plugin] Optimization Detective Issues for the Optimization Detective plugin skip changelog PRs that should not be mentioned in changelogs labels Oct 20, 2024
@westonruter westonruter added the [Type] Bug An existing feature is broken label Oct 20, 2024
Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: westonruter <[email protected]>
Co-authored-by: swissspidy <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@westonruter westonruter merged commit 7eccb23 into trunk Oct 20, 2024
19 of 23 checks passed
@westonruter westonruter deleted the fix/deprecated-notice branch October 20, 2024 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Plugin] Optimization Detective Issues for the Optimization Detective plugin skip changelog PRs that should not be mentioned in changelogs [Type] Bug An existing feature is broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants