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

WordPress Trac noreply at wordpress.org
Tue Apr 20 14:47:17 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:"50772" 50772]:
 #!CommitTicketReference repository="" revision="50772"
 Code Modernization: Bring consistency to preparing some fields on Network
 Settings screen:

 * `illegal_names`
 * `limited_email_domains`
 * `banned_email_domains`

 If any of these options have a falsey value, treat it as an empty string.
 This addresses a PHP 8.1+ deprecation notice when passing a `null` value
 to `str_replace()`.

 Additionally, avoid unnecessary type casting for better performance.

 Props hellofromTonya, jrf, SergeyBiryukov.
 See #51423.

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

More information about the wp-trac mailing list