Make WordPress Core

Changeset 62175


Ignore:
Timestamp:
03/29/2026 10:29:55 PM (4 days ago)
Author:
SergeyBiryukov
Message:

Code Quality: Replace is_integer() with is_int() for consistency.

is_integer() is an alias for 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.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-pclzip.php

    r59506 r62175  
    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
     
    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
     
    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
     
    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
     
    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();
     
    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          }
     
    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();
  • trunk/src/wp-includes/IXR/class-IXR-value.php

    r42201 r62175  
    4545            return 'boolean';
    4646        }
    47         if (is_integer($this->data)) {
     47        if (is_int($this->data)) {
    4848            return 'int';
    4949        }
  • trunk/src/wp-includes/functions.php

    r62054 r62175  
    51065106
    51075107        if ( is_string( $path_element )
    5108             || is_integer( $path_element )
     5108            || is_int( $path_element )
    51095109            || null === $path_element
    51105110        ) {
     
    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        ) {
Note: See TracChangeset for help on using the changeset viewer.