Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#51014 closed defect (bug) (fixed)

Improve the structure format on the class-wp-media-list-table file

Reported by: laxman-prajapati's profile Laxman Prajapati Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.7 Priority: normal
Severity: normal Version: 4.0
Component: Administration Keywords: good-first-bug has-patch early commit
Focuses: coding-standards Cc:

Description

Improve the structure format of PHP code on the class-wp-media-list-table file for the understanding of which section are where closed.

Attachments (2)

51014.patch (5.7 KB) - added by Laxman Prajapati 4 years ago.
Created patch.
51014-2.patch (5.4 KB) - added by hansjovisyoast 4 years ago.

Download all attachments as: .zip

Change History (12)

@Laxman Prajapati
4 years ago

Created patch.

#1 @Laxman Prajapati
4 years ago

  • Keywords has-patch added

#2 @SergeyBiryukov
4 years ago

  • Component changed from General to Administration
  • Milestone changed from Awaiting Review to 5.6
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#3 @Laxman Prajapati
4 years ago

  • Keywords good-first-bug added

#4 @Laxman Prajapati
4 years ago

Any update on this?

#5 @hansjovisyoast
4 years ago

When reviewing we (a few colleagues: @justinahinon and @noudwordpress and myself) noticed a few code standard issues in the patch, which we addressed in 51014-2.patch:

  • The if statement on lines 272 to 276 was not correctly indented. It had one tab too many.
  • Line 425 had a trailing whitespace.

There is one code standard issue left about a strict comparison:

FILE: src/wp-admin/includes/class-wp-media-list-table.php
-------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------
 656 | WARNING | Found: ==. Use strict comparisons (=== or !==).
     |         | (WordPress.PHP.StrictComparisons.LooseComparison)
-------------------------------------------------------------------------------------------------------------------

Since this is a pre-existing issue, where fixing it could change the behavior, we decided to leave it as is.

Last edited 4 years ago by hansjovisyoast (previous) (diff)

#6 @helen
4 years ago

  • Keywords early added
  • Milestone changed from 5.6 to 5.7

I know this isn't a functional change but I don't really want to get into these types of changes here in late beta, marking for 5.7 early.

#7 @hellofromTonya
4 years ago

  • Version changed from trunk to 4.0

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


4 years ago

#9 @audrasjb
4 years ago

  • Keywords commit added

51014-2.patch looks good to me. Marking this for commit. Thanks all!

#10 @SergeyBiryukov
4 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 49975:

Coding Standards: Improve code layout in wp-admin/includes/class-wp-media-list-table.php.

This allows for better readability and easier understanding of where each section opens and closes.

Props laxman-prajapati, hansjovisyoast, audrasjb.
Fixes #51014.

Note: See TracTickets for help on using tickets.