From dc9b16ba4224259bd3ae2153f81686ed902391f2 Mon Sep 17 00:00:00 2001 From: im3dabasia Date: Mon, 23 Dec 2024 15:00:21 +0530 Subject: [PATCH 1/2] doc: Improve function doc comments --- src/wp-includes/option.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/wp-includes/option.php b/src/wp-includes/option.php index c84f1660f931b..34e3cfc9b9482 100644 --- a/src/wp-includes/option.php +++ b/src/wp-includes/option.php @@ -1283,9 +1283,9 @@ function delete_option( $option ) { * @since 6.6.0 * @access private * - * @param string $option The name of the option. - * @param mixed $value The value of the option to check its autoload value. - * @param mixed $serialized_value The serialized value of the option to check its autoload value. + * @param string $option The name of the option. + * @param mixed $value The value of the option to check its autoload value. + * @param mixed $serialized_value The serialized value of the option to check its autoload value. * @param bool|null $autoload The autoload value to check. * Accepts 'on'|true to enable or 'off'|false to disable, or * 'auto-on', 'auto-off', or 'auto' for internal purposes. @@ -1972,9 +1972,9 @@ function update_site_option( $option, $value ) { * * @global wpdb $wpdb WordPress database abstraction object. * - * @param int $network_id ID of the network. Can be null to default to the current network ID. - * @param string $option Name of the option to retrieve. Expected to not be SQL-escaped. - * @param mixed $default_value Optional. Value to return if the option doesn't exist. Default false. + * @param int|null $network_id ID of the network. Can be null to default to the current network ID. + * @param string $option Name of the option to retrieve. Expected to not be SQL-escaped. + * @param mixed $default_value Optional. Value to return if the option doesn't exist. Default false. * @return mixed Value set for the option. */ function get_network_option( $network_id, $option, $default_value = false ) { @@ -2233,8 +2233,8 @@ function add_network_option( $network_id, $option, $value ) { * * @global wpdb $wpdb WordPress database abstraction object. * - * @param int $network_id ID of the network. Can be null to default to the current network ID. - * @param string $option Name of the option to delete. Expected to not be SQL-escaped. + * @param int|null $network_id ID of the network. Can be null to default to the current network ID. + * @param string $option Name of the option to delete. Expected to not be SQL-escaped. * @return bool True if the option was deleted, false otherwise. */ function delete_network_option( $network_id, $option ) { @@ -2337,9 +2337,9 @@ function delete_network_option( $network_id, $option ) { * * @global wpdb $wpdb WordPress database abstraction object. * - * @param int $network_id ID of the network. Can be null to default to the current network ID. - * @param string $option Name of the option. Expected to not be SQL-escaped. - * @param mixed $value Option value. Expected to not be SQL-escaped. + * @param int|null $network_id ID of the network. Can be null to default to the current network ID. + * @param string $option Name of the option. Expected to not be SQL-escaped. + * @param mixed $value Option value. Expected to not be SQL-escaped. * @return bool True if the value was updated, false otherwise. */ function update_network_option( $network_id, $option, $value ) { From 7d572cb31953533b77257eb7939f63cba6549bc2 Mon Sep 17 00:00:00 2001 From: im3dabasia Date: Tue, 24 Dec 2024 00:29:55 +0530 Subject: [PATCH 2/2] refactor: alignment issue on doc block comment --- src/wp-includes/option.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/wp-includes/option.php b/src/wp-includes/option.php index 34e3cfc9b9482..4e6fd3a78133b 100644 --- a/src/wp-includes/option.php +++ b/src/wp-includes/option.php @@ -1283,15 +1283,15 @@ function delete_option( $option ) { * @since 6.6.0 * @access private * - * @param string $option The name of the option. - * @param mixed $value The value of the option to check its autoload value. - * @param mixed $serialized_value The serialized value of the option to check its autoload value. - * @param bool|null $autoload The autoload value to check. - * Accepts 'on'|true to enable or 'off'|false to disable, or - * 'auto-on', 'auto-off', or 'auto' for internal purposes. - * Any other autoload value will be forced to either 'auto-on', - * 'auto-off', or 'auto'. - * 'yes' and 'no' are supported for backward compatibility. + * @param string $option The name of the option. + * @param mixed $value The value of the option to check its autoload value. + * @param mixed $serialized_value The serialized value of the option to check its autoload value. + * @param bool|null $autoload The autoload value to check. + * Accepts 'on'|true to enable or 'off'|false to disable, or + * 'auto-on', 'auto-off', or 'auto' for internal purposes. + * Any other autoload value will be forced to either 'auto-on', + * 'auto-off', or 'auto'. + * 'yes' and 'no' are supported for backward compatibility. * @return string Returns the original $autoload value if explicit, or 'auto-on', 'auto-off', * or 'auto' depending on default heuristics. */