Skip to content

Commit 3b3b726

Browse files
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. git-svn-id: https://develop.svn.wordpress.org/trunk@62175 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 9cee595 commit 3b3b726

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/wp-admin/includes/class-pclzip.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ function create($p_filelist)
296296
$v_size--;
297297

298298
// ----- Look for first arg
299-
if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {
299+
if ((is_int($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {
300300

301301
// ----- Parse the options
302302
$v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,
@@ -479,7 +479,7 @@ function add($p_filelist)
479479
$v_size--;
480480

481481
// ----- Look for first arg
482-
if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {
482+
if ((is_int($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {
483483

484484
// ----- Parse the options
485485
$v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,
@@ -732,7 +732,7 @@ function extract()
732732
$v_arg_list = func_get_args();
733733

734734
// ----- Look for first arg
735-
if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {
735+
if ((is_int($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {
736736

737737
// ----- Parse the options
738738
$v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,
@@ -893,7 +893,7 @@ function extractByIndex($p_index)
893893
$v_size--;
894894

895895
// ----- Look for first arg
896-
if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {
896+
if ((is_int($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {
897897

898898
// ----- Parse the options
899899
$v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,
@@ -1479,7 +1479,7 @@ function privParseOptions(&$p_options_list, $p_size, &$v_result_list, $v_request
14791479

14801480
// ----- Check the value
14811481
$v_value = $p_options_list[$i+1];
1482-
if ((!is_integer($v_value)) || ($v_value<0)) {
1482+
if ((!is_int($v_value)) || ($v_value<0)) {
14831483
PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Integer expected for option '".PclZipUtilOptionText($p_options_list[$i])."'");
14841484
return PclZip::errorCode();
14851485
}
@@ -1646,7 +1646,7 @@ function privParseOptions(&$p_options_list, $p_size, &$v_result_list, $v_request
16461646
// ----- Parse items
16471647
$v_work_list = explode(",", $p_options_list[$i+1]);
16481648
}
1649-
else if (is_integer($p_options_list[$i+1])) {
1649+
else if (is_int($p_options_list[$i+1])) {
16501650
$v_work_list[0] = $p_options_list[$i+1].'-'.$p_options_list[$i+1];
16511651
}
16521652
else if (is_array($p_options_list[$i+1])) {
@@ -1944,7 +1944,7 @@ function privFileDescrParseAtt(&$p_file_list, &$p_filedescr, $v_options, $v_requ
19441944
break;
19451945

19461946
case PCLZIP_ATT_FILE_MTIME :
1947-
if (!is_integer($v_value)) {
1947+
if (!is_int($v_value)) {
19481948
PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". Integer expected for attribute '".PclZipUtilOptionText($v_key)."'");
19491949
return PclZip::errorCode();
19501950
}

src/wp-includes/IXR/class-IXR-value.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function calculateType()
4444
if ($this->data === true || $this->data === false) {
4545
return 'boolean';
4646
}
47-
if (is_integer($this->data)) {
47+
if (is_int($this->data)) {
4848
return 'int';
4949
}
5050
if (is_double($this->data)) {

src/wp-includes/functions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5105,7 +5105,7 @@ function _wp_array_get( $input_array, $path, $default_value = null ) {
51055105
}
51065106

51075107
if ( is_string( $path_element )
5108-
|| is_integer( $path_element )
5108+
|| is_int( $path_element )
51095109
|| null === $path_element
51105110
) {
51115111
/*
@@ -5182,7 +5182,7 @@ function _wp_array_set( &$input_array, $path, $value = null ) {
51825182

51835183
foreach ( $path as $path_element ) {
51845184
if (
5185-
! is_string( $path_element ) && ! is_integer( $path_element ) &&
5185+
! is_string( $path_element ) && ! is_int( $path_element ) &&
51865186
! is_null( $path_element )
51875187
) {
51885188
return;

0 commit comments

Comments
 (0)