[wp-trac] [WordPress Trac] #56791: Coding Standards fixes for WP 6.2

WordPress Trac noreply at wordpress.org
Mon Nov 14 18:09:39 UTC 2022


#56791: Coding Standards fixes for WP 6.2
----------------------------+-------------------------------
 Reporter:  desrosj         |       Owner:  (none)
     Type:  task (blessed)  |      Status:  new
 Priority:  normal          |   Milestone:  6.2
Component:  General         |     Version:
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |     Focuses:  coding-standards
----------------------------+-------------------------------

Comment (by SergeyBiryukov):

 Replying to [comment:7 TobiasBg]:
 > The question that arises: There are about 60 `false === strpos( ... )`
 and 150 `false !== strpos( ... )` in Core that could be replaced by `!
 str_contains( ... )` and `str_contains( ... )`. Should these be batch-
 replaced or rather left alone until the respective area of code is touched
 anyways? Likewise, possible `str_starts_with()` and `str_ends_with()`
 usage could be introduced.

 I am in favor of making a batch replacement to use `str_contains()`,
 `str_starts_with()`, and `str_ends_with()` where appropriate, for
 readability and consistency.

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


More information about the wp-trac mailing list