[wp-trac] [WordPress Trac] #51423: Fix function argument type issues reported by PHPStan

WordPress Trac noreply at wordpress.org
Mon Mar 29 19:35:51 UTC 2021


#51423: Fix function argument type issues reported by PHPStan
-------------------------------------------------+-------------------------
 Reporter:  SergeyBiryukov                       |       Owner:
                                                 |  hellofromTonya
     Type:  task (blessed)                       |      Status:  assigned
 Priority:  normal                               |   Milestone:  5.8
Component:  General                              |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  php8 has-patch has-unit-tests        |     Focuses:  coding-
  commit                                         |  standards
-------------------------------------------------+-------------------------

Comment (by SergeyBiryukov):

 In [changeset:"50613" 50613]:
 {{{
 #!CommitTicketReference repository="" revision="50613"
 Code Modernization: Check if the `_export_data_grouped` post meta is an
 array when generating a personal data export file.

 This avoids a fatal error on PHP 8 in
 `wp_privacy_generate_personal_data_export_file()` if the
 `_export_data_grouped` post meta exists but is not an array.

 Additionally, refactor unit tests for the function to:
 * Reduce redundant code
 * Switch to data provider
 * Test on the full HTML output instead of select pieces of the output
 * Expand unhappy path coverage

 Follow-up to [43012], [44786], [47146], [47278].

 Props hellofromTonya, jrf, xknown.
 See #51423.
 }}}

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


More information about the wp-trac mailing list