Make WordPress Core

Changeset 64045


Ignore:
Timestamp:
10/02/2026 01:57:35 AM (6 weeks ago)
Author:
westonruter
Message:

Code Quality: Pass documented values for deprecated arguments.

Four core calls passed a value to a deprecated parameter that did not match its documented type. None of these values are used, so there is no change in behavior.

These call sites were surfaced by narrowing the types of deprecated parameters in the PHPStan stubs. Fixing them first allows the corresponding PHPStan types to be added to core as docblock-only changes. The now-obsolete add_option() entry is removed from the PHPStan baseline.

Developed in ​https://github.com/WordPress/wordpress-develop/pull/13872.
Follow-up to r20080, r23766, r31443, r63024.

Props marian1, swissspidy, westonruter.
See #65817.

Location:
trunk
Files:
5 edited

Legend:

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

    r62537 r64045  
    636636                        }
    637637                        $basename = str_replace( '.', '-', wp_basename( $file ) ) . '-image' . $ext;
    638                         $uploaded = wp_upload_bits( $basename, '', $metadata['image']['data'] );
     638                        $uploaded = wp_upload_bits( $basename, null, $metadata['image']['data'] );
    639639                        if ( false === $uploaded['error'] ) {
    640640                                $image_attachment = array(
  • trunk/src/wp-admin/includes/upgrade.php

    r63494 r64045  
    18661866                        $uninstall_plugins = get_option( 'uninstall_plugins' );
    18671867                        delete_option( 'uninstall_plugins' );
    1868                         add_option( 'uninstall_plugins', $uninstall_plugins, null, false );
     1868                        add_option( 'uninstall_plugins', $uninstall_plugins, '', false );
    18691869                }
    18701870        }
  • trunk/src/wp-admin/update.php

    r61455 r64045  
    8888                        die();
    8989                }
    90                 iframe_header( __( 'Plugin Reactivation' ), true );
     90                iframe_header( __( 'Plugin Reactivation' ) );
    9191                if ( isset( $_GET['success'] ) ) {
    9292                        echo '<p>' . __( 'Plugin reactivated successfully.' ) . '</p>';
  • trunk/tests/phpstan/baselines/argument.type.neon

    r64043 r64045  
    320320                        path: ../../../src/wp-admin/includes/upgrade.php
    321321                -
    322                         message: '#^Parameter \#3 \$deprecated of function add_option expects string, null given\.$#'
    323                         identifier: argument.type
    324                         count: 1
    325                         path: ../../../src/wp-admin/includes/upgrade.php
    326                 -
    327322                        message: '#^Parameter \#1 \$bookmark_id of function clean_bookmark_cache expects int, string\|null given\.$#'
    328323                        identifier: argument.type
  • trunk/tests/phpunit/includes/install.php

    r63590 r64045  
    9292add_action( 'populate_options', '_set_default_permalink_structure_for_tests' );
    9393
    94 wp_install( WP_TESTS_TITLE, 'admin', WP_TESTS_EMAIL, true, null, 'password' );
     94wp_install( WP_TESTS_TITLE, 'admin', WP_TESTS_EMAIL, true, '', 'password' );
    9595
    9696// Delete dummy permalink structure, as prefilled above.
Note: See TracChangeset for help on using the changeset viewer.