Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#55692 closed enhancement (fixed)

Extra space at the time of initialization of value

Reported by: rajeshraval786's profile rajeshraval786 Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.1 Priority: normal
Severity: normal Version:
Component: Administration Keywords:
Focuses: coding-standards Cc:


There has been extra space in the initialization of value in the admin-ajax.php file which should be removed as per coding standards.

Attachments (1)

55692.patch (623 bytes) - added by rajeshraval786 2 years ago.
attached patch file with changes in admin-ajax.php file.

Download all attachments as: .zip

Change History (4)

2 years ago

attached patch file with changes in admin-ajax.php file.

#1 @costdev
2 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed
  • Version trunk deleted

Hi @rajeshraval786, welcome to Trac and thanks for working to ensure that WordPress Core adheres to the coding standard!

This equals sign is aligned with the equals sign in the assignment above it, so it's actually in accordance with the coding standard. Phew!

If you have ran composer install on your checkout of the repository, you can run this in your terminal to check this file (or any file) against the coding standard:

# From /path/to/wordpress-develop/
vendor/bin/phpcs src/wp-admin/admin-ajax.php
  • Before the patch, all will be fine.
  • After the patch, this is the result:

156 | WARNING | [x] Equals sign not aligned with surrounding assignments; expected 12 spaces but found 1 space

I'll close this ticket as invalid as this is the expected alignment.

Last edited 2 years ago by costdev (previous) (diff)

#2 @SergeyBiryukov
2 years ago

  • Milestone set to 6.1
  • Resolution invalid deleted
  • Status changed from closed to reopened

Hi there, welcome to WordPress Trac! Thanks for the ticket.

As noted above, 55692.patch is not quite correct, as the assignment needs to be aligned with the previous one.

However, we can both remove the extra space and avoid a WPCS warning by adding an empty line between the line in the patch and the assignment above, which should also make the block a bit more readable.

#3 @SergeyBiryukov
2 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from reopened to closed

In 53363:

Coding Standards: Remove extra space in wp-admin/admin-ajax.php.

Props rajeshraval786, costdev.
Fixes #55692.

Note: See TracTickets for help on using tickets.