[wp-trac] [WordPress Trac] #61860: PHPCS: Empty FOREACH statement detected

WordPress Trac noreply at wordpress.org
Mon Aug 12 16:14:50 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
-------------------------------+------------------------------

Comment (by TobiasBg):

 From a functionality point of view, this would probably work, but given
 that the `foreach` loop is an a code section that aims to optimize the
 function run, that speed gain would likely be impacted.

 Most likely, phpcs won't actually "complain" about jrf's suggestion (and
 if so, a `// phpcs:ignore` comment would be appropriate, I think) but only
 about the current syntax with the empty `{}` part.

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


More information about the wp-trac mailing list