Skip to content

Conversation

@anomiex
Copy link

@anomiex anomiex commented Nov 2, 2021

This fixes the "Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetExists() should be compatible with ArrayAccess::offsetExists(): bool" and similar warnings on PHP 8.1.

PHP native interfaces now have declared return types and methods in classes implementing these interfaces need to either have the return type declared (in a covariant compatible manner with the PHP native interface method declaration), or need to silence the deprecation warning using the #[ReturnTypeWillChange] attribute.

Trac ticket: https://core.trac.wordpress.org/ticket/53635


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

…n type in `src/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php`

This fixes the "Deprecated: Return type of `Requests_Utility_CaseInsensitiveDictionary::offsetExists()` should be compatible with `ArrayAccess::offsetExists(): bool`" and similar warnings on PHP 8.1.

PHP native interfaces now have declared return types and methods in classes implementing these interfaces need to either have the return type declared (in a covariant compatible manner with the PHP native interface method declaration), or need to silence the deprecation warning using the `#[ReturnTypeWillChange]` attribute.

Trac ticket: https://core.trac.wordpress.org/ticket/53635
@hellofromtonya
Copy link
Contributor

Hello @anomiex and thank you for your contribution. The fixes in this PR are for an external library, i.e. Requests. Fixes for this library should be made in its repo https://github.com/wordpress/requests and not in Core itself. Once Requests releases a new version, then Core will be updated.

@anomiex anomiex deleted the fix/php-8.1-Requests_Utility_CaseIns branch November 2, 2021 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants