[wp-trac] [WordPress Trac] #61860: PHPCS: Empty FOREACH statement detected
WordPress Trac
noreply at wordpress.org
Mon Aug 12 10:50:41 UTC 2024
#61860: PHPCS: Empty FOREACH statement detected
-------------------------------+------------------------------
Reporter: dhruvang21 | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Formatting | Version: 4.2.3
Severity: normal | Resolution:
Keywords: changes-requested | Focuses: docs
-------------------------------+------------------------------
Changes (by TobiasBg):
* keywords: has-patch => changes-requested
* focuses: coding-standards => docs
* type: defect (bug) => enhancement
* version: => 4.2.3
Comment:
Hi @dhruvang21!
Thanks for the ticket! However, while the `foreach` body is empty, these
lines can not be removed as they do have a purpose:
They make the `$needle` and `$replace` variables available for the lines
following this loop.
So, instead of removing the lines, maybe a clarifying comment would be
more reasonable.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/61860#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list