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
This commit is contained in:
Sergey Biryukov
2026-03-29 22:31:34 +00:00
parent 1545200c50
commit 2413d47223
4 changed files with 11 additions and 11 deletions

View File

@@ -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();
}

View File

@@ -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)) {

View File

@@ -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;

View File

@@ -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.