Make WordPress Core


Ignore:
Timestamp:
10/06/2026 05:00:29 PM (34 hours ago)
Author:
swissspidy
Message:

Docs: Narrow unused deprecated parameters in PHPStan types.

This adds @phpstan-param tags that narrow unused, deprecated parameters to the literal value of their default, so that static analysis flags callers which still pass something else. The types come from php-stubs/wordpress-stubs. wp_get_typography_font_size_value() narrows $settings to array, since passing a boolean was deprecated in 6.6.0.

validate_email() also stops passing its $check_domain argument to is_email(), where it is deprecated and triggered a second deprecation notice.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13889

Follow-up to r64045.

Props marian1, swissspidy, westonruter.
See #65817.

File:
1 edited

Legend:

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

    r63941 r64163  
    750750 * @param string $deprecated Use get_option() to check for an option in the options table.
    751751 * @return mixed User option value on success, false on failure.
     752 *
     753 * @phpstan-param '' $deprecated
    752754 */
    753755function get_user_option( $option, $user = 0, $deprecated = '' ) {
Note: See TracChangeset for help on using the changeset viewer.