Opened 5 weeks ago
Last modified 5 weeks ago
#63249 reviewing defect (bug)
Minor code and inline docs improvements in class-wp-rest-server.php
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.9 | Priority: | normal |
Severity: | normal | Version: | |
Component: | REST API | Keywords: | has-patch |
Focuses: | docs | Cc: |
Description
Inline Documentation Improvement
Some @param
tags are missing default value annotations. e.g:
@param string|null
— the default value should be specified when applicable.@param false|null
— missing mention of the default value.
Conditional Logic Adjustment
Function: get_json_last_error()
The current condition:
if ( JSON_ERROR_NONE === $last_error_code || empty( $last_error_code ) ) {
Proposed change:
if ( empty( $last_error_code ) || JSON_ERROR_NONE === $last_error_code ) {
This change reorders the condition to check for an empty value first, which is a common best practice. It improves readability and slightly optimizes performance by short-circuiting sooner when $last_error_code
is empty.
Change History (3)
Note: See
TracTickets for help on using
tickets.
In 60151: