WordPress.org

Make WordPress Core

Opened 6 weeks ago

Closed 8 days ago

#44028 closed defect (bug) (duplicate)

Conditional Statements are not meeting Yoda Conditions Coding Standards

Reported by: seusmaniqbal Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch
Focuses: administration, coding-standards Cc:

Description

A lot of conditional statements are not meeting Yoda conditions coding standards. Variables are placed on the left side instead of right side.

https://make.wordpress.org/core/handbook/best-practices/coding-standards/php/#yoda-conditions

https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/class-pclzip.php#L3636

Attachments (2)

44028.1.diff (9.0 KB) - added by seusmaniqbal 6 weeks ago.
Yoda conditions fixes
44028.2.diff (54.1 KB) - added by seusmaniqbal 6 weeks ago.
Yoda conditions fixes

Download all attachments as: .zip

Change History (7)

#1 @abdullahramzan
6 weeks ago

  • Focuses administration coding-standards added

@seusmaniqbal
6 weeks ago

Yoda conditions fixes

#2 @seusmaniqbal
6 weeks ago

  • Keywords has-patch added; needs-patch removed

@seusmaniqbal
6 weeks ago

Yoda conditions fixes

This ticket was mentioned in Slack in #core by abdullahramzan. View the logs.


4 weeks ago

#4 @abdullahramzan
9 days ago

#44365 was marked as a duplicate.

#5 @netweb
8 days ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Welcome to Trac @seusmaniqbal, apologies for not seeing this ticket earlier.

I'm going to also mark this ticket a duplicate, in #42885 an ongoing discussion regarding cores use of yoda conditions is taking place, once a decision has been reached then we will update the codebase with patches on that ticket.

Note: See TracTickets for help on using tickets.