Changeset 63522
- Timestamp:
- 09/07/2026 11:14:20 PM (6 weeks ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
src/wp-includes/functions.php (modified) (1 diff)
-
tests/phpstan/baselines/argument.type.neon (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r63511 r63522 5022 5022 * to be merged into another array. 5023 5023 * 5024 * The keys of the returned array are documented as strings, since that is what 5025 * callers mean by them, but they are not promised as such to static analysis. 5026 * Integer keys remain reachable through arguments that are perfectly valid: 5027 * `json_decode( '{"0":"a"}' )` is an object whose properties `get_object_vars()` 5028 * reports under an integer key, and `parse_str()` reads `0=a` as one as well. 5029 * 5024 5030 * @since 2.2.0 5025 5031 * @since 2.3.0 `$args` can now also be an object. 5026 5032 * 5027 * @param string|array|object $args Value to merge with $defaults. 5028 * @param array $defaults Optional. Array that serves as the defaults. 5029 * Default empty array. 5030 * @return array Merged user defined values with defaults. 5031 */ 5032 function wp_parse_args( $args, $defaults = array() ) { 5033 * @param string|array<string, mixed>|object $args Value to merge with $defaults. 5034 * @param array<string, mixed> $defaults Optional. Array that serves as the defaults. 5035 * Default empty array. 5036 * @return array<string, mixed> Merged user defined values with defaults. 5037 * @phpstan-return array<array-key, mixed> 5038 */ 5039 function wp_parse_args( $args, $defaults = array() ): array { 5033 5040 if ( is_object( $args ) ) { 5034 5041 $parsed_args = get_object_vars( $args ); -
trunk/tests/phpstan/baselines/argument.type.neon
r63510 r63522 1130 1130 path: ../../../src/wp-includes/pluggable.php 1131 1131 - 1132 message: '#^Parameter \#1 \$args of function get_pages expects array\{child_of\?\: int, sort_order\?\: string, sort_column\?\: string, hierarchical\?\: bool, exclude\?\: array\<int\>, include\?\: array\<int\>, meta_key\?\: string, meta_value\?\: string, \.\.\., \.\.\.\}\|string, non\-empty\-array given\.$#'1132 message: '#^Parameter \#1 \$args of function get_pages expects array\{child_of\?\: int, sort_order\?\: string, sort_column\?\: string, hierarchical\?\: bool, exclude\?\: array\<int\>, include\?\: array\<int\>, meta_key\?\: string, meta_value\?\: string, \.\.\., \.\.\.\}\|string, non\-empty\-array\<mixed\> given\.$#' 1133 1133 identifier: argument.type 1134 1134 count: 1 … … 1250 1250 path: ../../../src/wp-includes/rest-api/endpoints/class-wp-rest-application-passwords-controller.php 1251 1251 - 1252 message: '#^Parameter \#1 \$args of function wp_parse_args expects array\<string, mixed\>\|object\|string, list\<array\> given\.$#' 1253 identifier: argument.type 1254 count: 1 1255 path: ../../../src/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php 1256 - 1252 1257 message: '#^Parameter \#2 \$value of method WP_HTTP_Response\:\:header\(\) expects string, int given\.$#' 1253 1258 identifier: argument.type
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)