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

WordPress Trac noreply at wordpress.org
Mon Aug 2 22:30:20 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:"51529" 51529]:
 {{{
 #!CommitTicketReference repository="" revision="51529"
 Code Modernization: Silence the deprecation warnings for missing return
 type in `WP_Theme`.

 This fixes the "Deprecated: Return type of
 `WP_Theme::[METHODNAME]($offset)` 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].

 Props jrf.
 See #53635.
 }}}

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


More information about the wp-trac mailing list