WordPress.org

Make WordPress Core

Opened 6 weeks ago

Closed 29 hours ago

#49222 closed task (blessed) (fixed)

Coding Standards fixes for WP 5.4

Reported by: SergeyBiryukov Owned by:
Milestone: 5.4 Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: coding-standards Cc:

Description

Previously:

Change History (11)

#1 @SergeyBiryukov
6 weeks ago

In 47083:

Coding Standards: Remove unnecessary // phpcs:ignore instances in WP_Debug_Data.

WP_Theme::__get() accepts Name, Version, and Author theme properties in lower case too.

Additionally, remove one short ternary instance, not allowed per the coding standards.

See #49222.

#2 @jrf
6 weeks ago

FYI: the PHPCS Composer plugin has just released a new version, so updating it may be a good idea As Composer treats minors < 1.0 as majors, this requires an update in the composer.json file to ^0.6

Release log: https://github.com/Dealerdirect/phpcodesniffer-composer-installer/releases/tag/v0.6.0

#3 @SergeyBiryukov
5 weeks ago

In 47118:

Coding Standards: Disable WPCS warnings for date_default_timezone_set() and current_time( 'timestamp' ) calls in Date/Time tests.

These calls are intentional and required for the tests.

See #49222.

#4 @SergeyBiryukov
3 weeks ago

In 47197:

Coding Standards: Move WP_Object_Cache to wp-includes/class-wp-object-cache.php.

This ensures the file containing the WP_Object_Cache class conforms to the coding standards.

For backward compatibility, the new file is included from wp-includes/cache.php.

Fixes #49373. See #49222.

#5 @SergeyBiryukov
3 weeks ago

In 47219:

Coding Standards: Use Yoda conditions where appropriate.

See #49222.

#6 @SergeyBiryukov
3 weeks ago

In 47220:

Coding Standards: Correct the get_plugin_page_hook() check in wp-admin/admin.php.

The condition is meant to check for a non-empty string, however get_plugin_page_hook() can return null, in which case the strict check doesn't work as expected.

Follow-up to [47218].

See #48455, #49222.

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


2 weeks ago

#8 @SergeyBiryukov
2 weeks ago

In 47287:

Coding Standards: Rename $d parameter in various date/time functions to $format for clarity.

See #49222.

#9 @SergeyBiryukov
2 weeks ago

In 47288:

Tests: Rename $d variable in some date/time tests to $format for clarity.

Follow-up to [47287].

See #49222.

#10 @SergeyBiryukov
29 hours ago

In 47389:

Coding Standards: Update PHPCS Composer plugin to v0.6.0.

Release log: https://github.com/Dealerdirect/phpcodesniffer-composer-installer/releases/tag/v0.6.0

Props jrf.
See #49222.

#11 @SergeyBiryukov
29 hours ago

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

Follow-up: #49542

Note: See TracTickets for help on using tickets.