Make WordPress Core

Opened 7 years ago

Closed 6 years ago

#44028 closed defect (bug) (duplicate)

Conditional Statements are not meeting Yoda Conditions Coding Standards

Reported by: seusmaniqbal's profile 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 7 years ago.
Yoda conditions fixes
44028.2.diff (54.1 KB) - added by seusmaniqbal 7 years ago.
Yoda conditions fixes

Download all attachments as: .zip

Change History (7)

#1 @abdullahramzan
7 years ago

  • Focuses administration coding-standards added

@seusmaniqbal
7 years ago

Yoda conditions fixes

#2 @seusmaniqbal
7 years ago

  • Keywords has-patch added; needs-patch removed

@seusmaniqbal
7 years ago

Yoda conditions fixes

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


7 years ago

#4 @abdullahramzan
6 years ago

#44365 was marked as a duplicate.

#5 @netweb
6 years 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.