Make WordPress Core

Changeset 61426


Ignore:
Timestamp:
01/03/2026 07:37:01 AM (4 months ago)
Author:
westonruter
Message:

Script Loader: Add types for arrays in phpdoc.

This resolves 10 missingType.iterableValue issues in PHPStan.

Follow-up to [61402], [61362], [61358].

See #64224, #64238.

File:
1 edited

Legend:

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

    r61425 r61426  
    23482348 * @global bool      $concatenate_scripts
    23492349 *
    2350  * @return array|void
     2350 * @return string[]|void
    23512351 */
    23522352function print_late_styles() {
     
    25052505 * @since 6.1.0
    25062506 *
    2507  * @param array $nodes The nodes to filter.
    2508  * @return array A filtered array of style nodes.
     2507 * @param array<array<string, mixed>> $nodes The nodes to filter.
     2508 * @return array<array<string, mixed>> A filtered array of style nodes.
    25092509 */
    25102510function wp_filter_out_block_nodes( $nodes ) {
     
    28662866 * @since 5.7.0
    28672867 *
    2868  * @param array $attributes Key-value pairs representing `<script>` tag attributes.
     2868 * @param array<string, string|bool> $attributes Key-value pairs representing `<script>` tag attributes.
    28692869 * @return string String made of sanitized `<script>` tag attributes.
    28702870 */
     
    28972897 * @since 5.7.0
    28982898 *
    2899  * @param array $attributes Key-value pairs representing `<script>` tag attributes.
     2899 * @param array<string, string|bool> $attributes Key-value pairs representing `<script>` tag attributes.
    29002900 * @return string String containing `<script>` opening and closing tags.
    29012901 */
     
    29232923 * @since 5.7.0
    29242924 *
    2925  * @param array $attributes Key-value pairs representing `<script>` tag attributes.
     2925 * @param array<string, string|bool> $attributes Key-value pairs representing `<script>` tag attributes.
    29262926 */
    29272927function wp_print_script_tag( $attributes ) {
     
    29372937 * @since 5.7.0
    29382938 *
    2939  * @param string $data       Data for script tag: JavaScript, importmap, speculationrules, etc.
    2940  * @param array  $attributes Optional. Key-value pairs representing `<script>` tag attributes.
     2939 * @param string                     $data       Data for script tag: JavaScript, importmap, speculationrules, etc.
     2940 * @param array<string, string|bool> $attributes Optional. Key-value pairs representing `<script>` tag attributes.
    29412941 * @return string String containing inline JavaScript code wrapped around `<script>` tag.
    29422942 */
     
    29492949     * @since 5.7.0
    29502950     *
    2951      * @param array  $attributes Key-value pairs representing `<script>` tag attributes.
    2952      *                           Only the attribute name is added to the `<script>` tag for
    2953      *                           entries with a boolean value, and that are true.
    2954      * @param string $data       Inline data.
     2951     * @param array<string, string|bool> $attributes Key-value pairs representing `<script>` tag attributes.
     2952     *                                               Only the attribute name is added to the `<script>` tag for
     2953     *                                               entries with a boolean value, and that are true.
     2954     * @param string                     $data       Inline data.
    29552955     */
    29562956    $attributes = apply_filters( 'wp_inline_script_attributes', $attributes, $data );
     
    29672967 * @since 5.7.0
    29682968 *
    2969  * @param string $data       Data for script tag: JavaScript, importmap, speculationrules, etc.
    2970  * @param array  $attributes Optional. Key-value pairs representing `<script>` tag attributes.
     2969 * @param string                     $data       Data for script tag: JavaScript, importmap, speculationrules, etc.
     2970 * @param array<string, string|bool> $attributes Optional. Key-value pairs representing `<script>` tag attributes.
    29712971 */
    29722972function wp_print_inline_script_tag( $data, $attributes = array() ) {
     
    31893189 * @since 6.1.0
    31903190 *
    3191  * @param array $options {
     3191 * @param array<string, bool> $options {
    31923192 *     Optional. An array of options to pass to wp_style_engine_get_stylesheet_from_context().
    31933193 *     Default empty array.
     
    32613261 * @since 5.9.0
    32623262 *
    3263  * @param string $block_name The block-name, including namespace.
    3264  * @param array  $args       {
     3263 * @param string                                   $block_name The block-name, including namespace.
     3264 * @param array<string, string|string[]|bool|null> $args       {
    32653265 *     An array of arguments. See wp_register_style() for full information about each argument.
    32663266 *
Note: See TracChangeset for help on using the changeset viewer.