Make WordPress Core

Changeset 63333


Ignore:
Timestamp:
08/21/2026 04:09:21 PM (8 weeks ago)
Author:
SergeyBiryukov
Message:

Docs: Remove a blank line between @param and @return in test docblocks.

The ​PHP inline documentation standards place @return immediately after the last @param tag, with no blank line between them:

/**
 * Summary.
 *
 * @param string $var Description.
 * @return string Description.
 */

This corrects 65 docblocks across 29 files in the PHPUnit test suite.

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

Follow-up to [63320].

Props mukesh27.
See #65818, #65860.

Location:
trunk/tests/phpunit
Files:
29 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/factory/class-wp-unittest-factory-callback-after-create.php

    r55019 r63333  
    2525         *
    2626         * @param int $object_id ID of the object to apply the callback on.
    27          *
    2827         * @return mixed Updated object field.
    2928         */
  • trunk/tests/phpunit/includes/factory/class-wp-unittest-factory-for-attachment.php

    r60289 r63333  
    2727         * @param int   $legacy_parent Deprecated.
    2828         * @param array $legacy_args   Deprecated.
    29          *
    3029         * @return int|WP_Error The attachment ID on success, WP_Error object on failure.
    3130         */
    … …  
    5958         *                               The name of the file will be used as the attachment name.
    6059         * @param int    $parent_post_id ID of the post to attach the file to.
    61          *
    6260         * @return int|WP_Error The attachment ID on success, WP_Error object on failure.
    6361         */
  • trunk/tests/phpunit/includes/factory/class-wp-unittest-factory-for-blog.php

    r56943 r63333  
    2828         *
    2929         * @param array $args Arguments for the site object.
    30          *
    3130         * @return int|WP_Error The site ID on success, WP_Error object on failure.
    3231         */
    … …  
    8180         *
    8281         * @param int $blog_id ID of the site to retrieve.
    83          *
    8482         * @return WP_Site|null The site object on success, null on failure.
    8583         */
  • trunk/tests/phpunit/includes/factory/class-wp-unittest-factory-for-bookmark.php

    r55019 r63333  
    3030         *
    3131         * @param array $args Arguments for the link object.
    32          *
    3332         * @return int|WP_Error The link ID on success, WP_Error object on failure.
    3433         */
    … …  
    4544         * @param int   $link_id ID of the link to update.
    4645         * @param array $fields  The fields to update.
    47          *
    4846         * @return int|WP_Error The link ID on success, WP_Error object on failure.
    4947         */
    … …  
    6664         *
    6765         * @param int $link_id ID of the link to retrieve.
    68          *
    6966         * @return object|null The link object on success, null on failure.
    7067         */
  • trunk/tests/phpunit/includes/factory/class-wp-unittest-factory-for-comment.php

    r55019 r63333  
    3232         *
    3333         * @param array $args The comment details.
    34          *
    3534         * @return int|WP_Error The comment ID on success, WP_Error object on failure.
    3635         */
    … …  
    5958         * @param int   $comment_id The comment ID.
    6059         * @param array $fields     The comment details.
    61          *
    6260         * @return int|WP_Error The value 1 if the comment was updated, 0 if not updated.
    6361         *                      WP_Error object on failure.
    … …  
    7775         * @param array $args                   The comment details.
    7876         * @param null  $generation_definitions Default values.
    79          *
    8077         * @return int[] Array with the comment IDs.
    8178         */
    … …  
    9188         *
    9289         * @param int $comment_id ID of the comment to retrieve.
    93          *
    9490         * @return WP_Comment|null WP_Comment object on success, null on failure.
    9591         */
  • trunk/tests/phpunit/includes/factory/class-wp-unittest-factory-for-network.php

    r56943 r63333  
    3131         *
    3232         * @param array $args Arguments for the network object.
    33          *
    3433         * @return int|WP_Error The network ID on success, WP_Error object on failure.
    3534         */
    … …  
    7574         *
    7675         * @param int $network_id ID of the network to retrieve.
    77          *
    7876         * @return WP_Network|null The network object on success, null on failure.
    7977         */
  • trunk/tests/phpunit/includes/factory/class-wp-unittest-factory-for-post.php

    r55019 r63333  
    3131         *
    3232         * @param array $args Array with elements for the post.
    33          *
    3433         * @return int|WP_Error The post ID on success, WP_Error object on failure.
    3534         */
    … …  
    4645         * @param int   $post_id ID of the post to update.
    4746         * @param array $fields  Post data.
    48          *
    4947         * @return int|WP_Error The post ID on success, WP_Error object on failure.
    5048         */
    … …  
    6058         *
    6159         * @param int $post_id ID of the post to retrieve.
    62          *
    6360         * @return WP_Post|null WP_Post object on success, null on failure.
    6461         */
  • trunk/tests/phpunit/includes/factory/class-wp-unittest-factory-for-term.php

    r61424 r63333  
    3232         *
    3333         * @param array $args Array of arguments for inserting a term.
    34          *
    3534         * @return int|WP_Error The term ID on success, WP_Error object on failure.
    3635         */
    … …  
    5453         * @param int|object $term   The term to update.
    5554         * @param array      $fields Array of arguments for updating a term.
    56          *
    5755         * @return int|WP_Error The term ID on success, WP_Error object on failure.
    5856         */
    … …  
    10098         * @param array $args                   Array or string of arguments for inserting a term.
    10199         * @param null  $generation_definitions The default values.
    102          *
    103100         * @return WP_Term|WP_Error|null WP_Term on success. WP_Error if taxonomy does not exist. Null for miscellaneous failure.
    104101         */
    … …  
    121118         *
    122119         * @param int $term_id ID of the term to retrieve.
    123          *
    124120         * @return WP_Term|WP_Error|null WP_Term on success. WP_Error if taxonomy does not exist. Null for miscellaneous failure.
    125121         */
  • trunk/tests/phpunit/includes/factory/class-wp-unittest-factory-for-thing.php

    r57987 r63333  
    3535         *
    3636         * @param array $args The arguments.
    37          *
    3837         * @return int|WP_Error The object ID on success, WP_Error object on failure.
    3938         */
    … …  
    4746         * @param int   $object_id The object ID.
    4847         * @param array $fields    The values to update.
    49          *
    5048         * @return int|WP_Error The object ID on success, WP_Error object on failure.
    5149         */
    … …  
    116114         *
    117115         * @param int $object_id The object ID.
    118          *
    119116         * @return mixed The object. Can be anything.
    120117         */
    … …  
    198195         * @param WP_UnitTest_Factory_Callback_After_Create[] $callbacks Array with callback functions.
    199196         * @param int                                         $object_id ID of the object to apply callbacks for.
    200          *
    201197         * @return array The altered fields.
    202198         */
    … …  
    217213         *
    218214         * @param callable $callback The callback function.
    219          *
    220215         * @return WP_UnitTest_Factory_Callback_After_Create
    221216         */
    … …  
    230225         *
    231226         * @param array|object|string|mixed $value The value to add slashes to.
    232          *
    233227         * @return array|string The value with the possibly applied slashes.
    234228         */
  • trunk/tests/phpunit/includes/factory/class-wp-unittest-factory-for-user.php

    r55019 r63333  
    2828         *
    2929         * @param array $args The user data to insert.
    30          *
    3130         * @return int|WP_Error The user ID on success, WP_Error object on failure.
    3231         */
    … …  
    4241         * @param int   $user_id ID of the user to update.
    4342         * @param array $fields  The user data to update.
    44          *
    4543         * @return int|WP_Error The user ID on success, WP_Error object on failure.
    4644         */
    … …  
    5654         *
    5755         * @param int $user_id ID of the user ID to retrieve.
    58          *
    5956         * @return WP_User The user object.
    6057         */
  • trunk/tests/phpunit/tests/ajax/wpAjaxCropImage.php

    r54722 r63333  
    215215        /**
    216216         * @param WP_Post $attachment
    217          *
    218217         * @return string
    219218         */
  • trunk/tests/phpunit/tests/ajax/wpAjaxWpPrivacyErasePersonalData.php

    r55337 r63333  
    171171         *
    172172         * @param array $erasers List of data erasers.
    173          *
    174173         * @return array Array of data erasers.
    175174         */
    … …  
    198197         *
    199198         * @param array $erasers Erasers.
    200          *
    201199         * @return array Erasers.
    202200         */
    … …  
    230228         * @param string $email_address The requester's email address.
    231229         * @param int    $page          Page number.
    232          *
    233230         * @return array Export data.
    234231         */
    … …  
    640637         * @param string $email_address The requester's email address.
    641638         * @param int    $page          Page number.
    642          *
    643639         * @return array Export data.
    644640         */
    … …  
    742738         * @param int    $request_id      The privacy request post ID associated with this request.
    743739         * @param string $eraser_key      The key (slug) of the eraser that provided this data.
    744          *
    745740         * @return array Filtered erase response.
    746741         */
    … …  
    761756         *
    762757         * @param array $erasers An array of personal data erasers.
    763          *
    764758         * @return array An array of personal data erasers.
    765759         */
    … …  
    779773         * @param  string $email_address The comment author email address.
    780774         * @param  int    $page          Page number.
    781          *
    782775         * @return array Erase data.
    783776         */
  • trunk/tests/phpunit/tests/ajax/wpAjaxWpPrivacyExportPersonalData.php

    r55337 r63333  
    205205         *
    206206         * @param array $exporters List of data exporters.
    207          *
    208207         * @return array List of data exporters.
    209208         */
    … …  
    580579         * @param string $email_address The requester's email address.
    581580         * @param int    $page          Page number.
    582          *
    583581         * @return array Export data.
    584582         */
    … …  
    616614         * @param  string $email_address The requester's email address.
    617615         * @param  int    $page          Page number.
    618          *
    619616         * @return array Export data.
    620617         */
    … …  
    651648         * @param string $email_address The requester's email address.
    652649         * @param int    $page          Page number.
    653          *
    654650         * @return array Export data.
    655651         */
    … …  
    730726         * @param bool   $send_as_email   Whether the final results of the export should be emailed to the user.
    731727         * @param string $exporter_key    The key (slug) of the exporter that provided this data.
    732          *
    733728         * @return array The personal data for the given exporter and page.
    734729         */
    … …  
    758753         *
    759754         * @param array $exporters An array of personal data exporters.
    760          *
    761755         * @return array An array of personal data exporters.
    762756         */
    … …  
    776770         * @param string $email_address The requester's email address.
    777771         * @param int    $page          Page number.
    778          *
    779772         * @return array Export data response.
    780773         */
  • trunk/tests/phpunit/tests/block-supports/aria-label.php

    r61671 r63333  
    2727         * @param string $block_name Name for the test block.
    2828         * @param array  $supports   Array defining block support configuration.
    29          *
    3029         * @return WP_Block_Type The block type for the newly registered test block.
    3130         */
  • trunk/tests/phpunit/tests/block-supports/shadow.php

    r58318 r63333  
    2727         * @param string $block_name Name for the test block.
    2828         * @param array  $supports   Array defining block support configuration.
    29          *
    3029         * @return WP_Block_Type The block type for the newly registered test block.
    3130         */
  • trunk/tests/phpunit/tests/blocks/wpBlockType.php

    r62969 r63333  
    589589         * @param array $variations Block variations before filter.
    590590         * @param WP_Block_Type $block_type Block type.
    591          *
    592591         * @return array Block variations after filter.
    593592         */
  • trunk/tests/phpunit/tests/customize/manager.php

    r62745 r63333  
    32533253         * @param array                $components         Components.
    32543254         * @param WP_Customize_Manager $customize_manager  Manager.
    3255          *
    32563255         * @return array Components.
    32573256         */
    … …  
    32703269         * @param array                $components         Components.
    32713270         * @param WP_Customize_Manager $customize_manager  Manager.
    3272          *
    32733271         * @return array Components.
    32743272         */
    … …  
    35623560         *
    35633561         * @param array $devices The list of devices.
    3564          *
    35653562         * @return array
    35663563         */
  • trunk/tests/phpunit/tests/customize/selective-refresh-ajax.php

    r60253 r63333  
    360360         * @param array  $partial_args Partial args.
    361361         * @param string $partial_id   Partial ID.
    362          *
    363362         * @return array|false Args.
    364363         */
  • trunk/tests/phpunit/tests/customize/setting.php

    r62489 r63333  
    353353         * @param mixed $default_value
    354354         * @param WP_Customize_Setting $setting
    355          *
    356355         * @return mixed|null
    357356         */
    … …  
    742741         * @param WP_Error $validity Validity.
    743742         * @param string   $value    Value.
    744          *
    745743         * @return WP_Error
    746744         */
  • trunk/tests/phpunit/tests/functions.php

    r63312 r63333  
    420420         *
    421421         * @param array $formats
    422          *
    423422         * @return array
    424423         */
  • trunk/tests/phpunit/tests/html-api/wpHtmlProcessorWebPlatformTests.php

    r62734 r63333  
    138138         * @param string|null $test_context_element Context element for fragment parsing, or null for full document parsing.
    139139         * @param string      $test_name            Test name.
    140          *
    141140         * @return bool True if the test case should be skipped. False otherwise.
    142141         */
    … …  
    354353         *
    355354         * @param string $filename Path to `.dat` file with test cases.
    356          *
    357355         * @return Generator<int, array{
    358356         *     non-negative-int, // Line number.
  • trunk/tests/phpunit/tests/image/editor.php

    r60729 r63333  
    173173         *
    174174         * @param array $formats
    175          *
    176175         * @return array
    177176         */
  • trunk/tests/phpunit/tests/kses/wpFilterGlobalStylesPost.php

    r54382 r63333  
    7272         *
    7373         * @param array $theme_data Theme data to filter.
    74          *
    7574         * @return array Filtered theme data.
    7675         */
  • trunk/tests/phpunit/tests/post/metaRevisions.php

    r59979 r63333  
    1616         *
    1717         * @param array $keys The array of revisioned keys.
    18          *
    1918         * @return array
    2019         */
  • trunk/tests/phpunit/tests/privacy/wpPrivacyDeleteOldExportFiles.php

    r58221 r63333  
    9797         *
    9898         * @param string $exports_dir The default personal data export directory.
    99          *
    10099         * @return string The path to a folder that doesn't exist.
    101100         */
  • trunk/tests/phpunit/tests/rest-api/rest-sidebars-controller.php

    r59970 r63333  
    11301130         *
    11311131         * @param array $data Array of data.
    1132          *
    11331132         * @return array
    11341133         */
  • trunk/tests/phpunit/tests/rest-api/rest-widgets-controller.php

    r62817 r63333  
    17291729         *
    17301730         * @param array $data Array of data.
    1731          *
    17321731         * @return array
    17331732         */
  • trunk/tests/phpunit/tests/rest-api/wpRestMenuItemsController.php

    r59718 r63333  
    10121012        /**
    10131013         * @param array $args Override params.
    1014          *
    10151014         * @return mixed
    10161015         */
  • trunk/tests/phpunit/tests/term/wpGenerateTagCloud.php

    r60251 r63333  
    301301         *
    302302         * @param array $get_terms_args Options passed to get_terms()
    303          *
    304303         * @return array
    305304         */
Note: See TracChangeset for help on using the changeset viewer.