#59731 closed enhancement (invalid)
Count function inside of the loop not allowed as per phpcs rules
Reported by: | mihirdev21 | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | General | Keywords: | has-patch |
Focuses: | coding-standards | Cc: |
Description
I have checked the rss.php file and i discovered that the count function is not allowed in the loop as per phpcs rules so i have added two variables and updated the code
Attachments (1)
Change History (7)
#2
follow-up:
↓ 3
@
14 months ago
Hi there, welcome to WordPress Trac! Thanks for the ticket.
Please note that wp-includes/rss.php
is a former external library (MagpieRSS). It does not follow the WordPress coding standards, which is why it is excluded from PHPCS checks.
#3
in reply to:
↑ 2
@
14 months ago
- Resolution set to invalid
- Status changed from new to closed
Replying to SergeyBiryukov:
Hi there, welcome to WordPress Trac! Thanks for the ticket.
Please note that
wp-includes/rss.php
is a former external library (MagpieRSS). It does not follow the WordPress coding standards, which is why it is excluded from PHPCS checks.
Hello there @SergeyBiryukov
got it...thank you so much for the quick reply! Have a great rest of the day! : )
#4
@
14 months ago
Also note that the rule to disallow/discourage using functions like count()
in a loop condition is a rule which does not apply to WP Core. It is not part of the formal coding standards.
It is a recommendation/best practice rule which is in the WordPress-Extra
ruleset, which should not be used for WP Core.
Patch added!