#62164 closed defect (bug) (wontfix)
Fix PHPCS "Yoda Condition checks" of WordPress Core file media.php.
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | General | Keywords: | has-patch |
Focuses: | Cc: |
Description
in wp-includes/media.php file Fix PHPCS "Yoda Condition checks" needs to be fixed
In this ticket I am adding patch to fix PHPCS "Yoda Condition checks" errors in media.php.
Change History (7)
This ticket was mentioned in PR #7491 on WordPress/wordpress-develop by @deepakrohilla.
9 months ago
#1
#2
@
9 months ago
Hi @deepakrohilla, Thanks for reporting this, but I don't think this is needed/required as it doesn't involve a comparison with a variable, rather with the count.
Please also check: https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#yoda-conditions
@debarghyabanerjee commented on PR #7491:
9 months ago
#3
This patch should not be applied, as it doesn't involve comparison with a variable.
@pratiklondhe commented on PR #7491:
9 months ago
#5
Yes, makes sense to not merge this, as purpose of using YODA condition is to throw error if we accidentally use =
(assignment) instead of ==
(comparison ),
- here the order doesn't matter as we can not assign any value to a function's return value anyways ( it will throw error )
@mukesh27 commented on PR #7491:
9 months ago
#6
The ticket was closed. Feel free to reopen.
https://core.trac.wordpress.org/ticket/62164