From 2413d47223fc4c9e3707b1df72574991a2303feb Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 29 Mar 2026 22:31:34 +0000 Subject: [PATCH] Code Quality: Replace `is_integer()` with `is_int()` for consistency. [https://www.php.net/manual/en/function.is-integer.php is_integer()] is an alias for [https://www.php.net/manual/en/function.is-int.php is_int()]. While they function identically, the WordPress Coding Standards and modern PHP practices generally lean towards using the official function name rather than its alias to maintain consistency across the codebase. Props Soean, westonruter, SergeyBiryukov. See #64913. Built from https://develop.svn.wordpress.org/trunk@62175 git-svn-id: http://core.svn.wordpress.org/trunk@61457 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-pclzip.php | 14 +++++++------- wp-includes/IXR/class-IXR-value.php | 2 +- wp-includes/functions.php | 4 ++-- wp-includes/version.php | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/wp-admin/includes/class-pclzip.php b/wp-admin/includes/class-pclzip.php index f1128d900c..1fdc8b9f41 100644 --- a/wp-admin/includes/class-pclzip.php +++ b/wp-admin/includes/class-pclzip.php @@ -296,7 +296,7 @@ $v_size--; // ----- Look for first arg - if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { + if ((is_int($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { // ----- Parse the options $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, @@ -479,7 +479,7 @@ $v_size--; // ----- Look for first arg - if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { + if ((is_int($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { // ----- Parse the options $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, @@ -732,7 +732,7 @@ $v_arg_list = func_get_args(); // ----- Look for first arg - if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { + if ((is_int($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { // ----- Parse the options $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, @@ -893,7 +893,7 @@ $v_size--; // ----- Look for first arg - if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { + if ((is_int($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { // ----- Parse the options $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, @@ -1479,7 +1479,7 @@ // ----- Check the value $v_value = $p_options_list[$i+1]; - if ((!is_integer($v_value)) || ($v_value<0)) { + if ((!is_int($v_value)) || ($v_value<0)) { PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Integer expected for option '".PclZipUtilOptionText($p_options_list[$i])."'"); return PclZip::errorCode(); } @@ -1646,7 +1646,7 @@ // ----- Parse items $v_work_list = explode(",", $p_options_list[$i+1]); } - else if (is_integer($p_options_list[$i+1])) { + else if (is_int($p_options_list[$i+1])) { $v_work_list[0] = $p_options_list[$i+1].'-'.$p_options_list[$i+1]; } else if (is_array($p_options_list[$i+1])) { @@ -1944,7 +1944,7 @@ break; case PCLZIP_ATT_FILE_MTIME : - if (!is_integer($v_value)) { + if (!is_int($v_value)) { PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". Integer expected for attribute '".PclZipUtilOptionText($v_key)."'"); return PclZip::errorCode(); } diff --git a/wp-includes/IXR/class-IXR-value.php b/wp-includes/IXR/class-IXR-value.php index 0fd878bcac..20c205d128 100644 --- a/wp-includes/IXR/class-IXR-value.php +++ b/wp-includes/IXR/class-IXR-value.php @@ -44,7 +44,7 @@ class IXR_Value { if ($this->data === true || $this->data === false) { return 'boolean'; } - if (is_integer($this->data)) { + if (is_int($this->data)) { return 'int'; } if (is_double($this->data)) { diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 262b069e6d..991ebb6f45 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -5105,7 +5105,7 @@ function _wp_array_get( $input_array, $path, $default_value = null ) { } if ( is_string( $path_element ) - || is_integer( $path_element ) + || is_int( $path_element ) || null === $path_element ) { /* @@ -5182,7 +5182,7 @@ function _wp_array_set( &$input_array, $path, $value = null ) { foreach ( $path as $path_element ) { if ( - ! is_string( $path_element ) && ! is_integer( $path_element ) && + ! is_string( $path_element ) && ! is_int( $path_element ) && ! is_null( $path_element ) ) { return; diff --git a/wp-includes/version.php b/wp-includes/version.php index 70d7be10fe..441f323390 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '7.1-alpha-62174'; +$wp_version = '7.1-alpha-62175'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.