[wp-trac] [WordPress Trac] #53635: PHP 8.1: various compatibility fixes

WordPress Trac noreply at wordpress.org
Tue Aug 3 11:12:00 UTC 2021


#53635: PHP 8.1: various compatibility fixes
----------------------------+-------------------------------
 Reporter:  SergeyBiryukov  |       Owner:  (none)
     Type:  task (blessed)  |      Status:  new
 Priority:  normal          |   Milestone:  5.9
Component:  General         |     Version:
 Severity:  normal          |  Resolution:
 Keywords:  php81           |     Focuses:  coding-standards
----------------------------+-------------------------------

Comment (by SergeyBiryukov):

 In [changeset:"51532" 51532]:
 {{{
 #!CommitTicketReference repository="" revision="51532"
 Code Modernization: Silence the deprecation warnings for missing return
 type in `WP_Block_List`.

 This fixes the "Deprecated: Return type of `WP_Block_List::[METHODNAME]()`
 should be compatible with `ArrayAccess::[METHODNAME](): type`" 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.

 Follow-up to [51517], [51529], [51530], [51531].

 Props jrf.
 See #53635.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53635#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list