Make WordPress Core

Changeset 56943

Timestamp:
10/16/2023 03:15:14 PM (10 months ago)
Author:
flixos90
Message:

General: Remove discouraged @return void annotations.

Such @return void annotations must not be used in WordPress core's PHP code, except bundled themes, third-party libraries, and PHP compatibility shims.

Props isabel_brison, swissspidy.
Fixes #59619.

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/block-template-utils.php

    r56896 r56943  
    479479 *
    480480 * @param array $block a parsed block.
    481  * @return void
    482481 */
    483482function _inject_theme_attribute_in_template_part_block( &$block ) {
     
    497496 *
    498497 * @param array $block a parsed block.
    499  * @return void
    500498 */
    501499function _remove_theme_attribute_from_template_part_block( &$block ) {
  • trunk/src/wp-includes/class-wp-theme.php

    r56835 r56943  
    777777     *
    778778     * Prevents a callback from being injected during unserialization of an object.
    779      *
    780      * @return void
    781779     */
    782780    public function __wakeup() {
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-navigation-fallback-controller.php

    r56257 r56943  
    4141     *
    4242     * @since 6.3.0
    43      *
    44      * @return void
    4543     */
    4644    public function register_routes() {
  • trunk/tests/phpunit/includes/factory/class-wp-unittest-factory-for-blog.php

    r55019 r56943  
    7474     * @param int   $blog_id ID of the site to update.
    7575     * @param array $fields  The fields to update.
    76      *
    77      * @return void
    7876     */
    7977    public function update_object( $blog_id, $fields ) {}
  • trunk/tests/phpunit/includes/factory/class-wp-unittest-factory-for-network.php

    r55019 r56943  
    6666     * @param int   $network_id ID of the network to update.
    6767     * @param array $fields  The fields to update.
    68      *
    69      * @return void
    7068     */
    7169    public function update_object( $network_id, $fields ) {}
  • trunk/tests/phpunit/includes/object-cache.php

    r56161 r56943  
    821821 *
    822822 * @param int $blog_id Blog to switch to.
    823  * @return void
    824823 */
    825824function wp_cache_switch_to_blog( $blog_id ) {
     
    833832 *
    834833 * @global WP_Object_Cache $wp_object_cache WordPress Object Cache
    835  * @return void
    836834 */
    837835function wp_cache_init() {
     
    844842 *
    845843 * @param string|array $groups A group or an array of groups to add.
    846  * @return void
    847844 */
    848845function wp_cache_add_global_groups( $groups ) {
     
    855852 *
    856853 * @param string|array $groups A group or an array of groups to add.
    857  * @return void
    858854 */
    859855function wp_cache_add_non_persistent_groups( $groups ) {
     
    23302326     *
    23312327     * @param array $groups Array of groups.
    2332      * @return void
    23332328     */
    23342329    public function add_global_groups( $groups ) {
     
    23502345     *
    23512346     * @param array $groups Array of groups.
    2352      * @return void
    23532347     */
    23542348    public function add_non_persistent_groups( $groups ) {
     
    23822376     *
    23832377     * @param int $blog_id Blog to switch to.
    2384      * @return void
    23852378     */
    23862379    public function switch_to_blog( $blog_id ) {
  • trunk/tests/phpunit/tests/admin/includesPost.php

    r56587 r56943  
    11451145    /**
    11461146     * Test refreshed nonce for metabox loader.
    1147      *
    1148      * @return void
    11491147     */
    11501148    public function test_user_get_refreshed_metabox_nonce() {
  • trunk/tests/phpunit/tests/block-supports/wpRenderElementsSupport.php

    r56828 r56943  
    2626     *
    2727     * @covers ::wp_render_elements_support
    28      *
    29      * @return void
    3028     */
    3129    public function test_leaves_block_content_alone_when_block_type_not_registered() {
  • trunk/tests/phpunit/tests/html-api/wpHtmlProcessorBreadcrumbs.php

    r56941 r56943  
    301301     * @param array  $breadcrumbs Breadcrumbs of element with "target" attribute set.
    302302     * @param int    $ignored_n   Not used in this test but provided in the dataset for other tests.
    303      * @return void
    304303     */
    305304    public function test_reports_correct_breadcrumbs_for_html( $html, $breadcrumbs, $ignored_n ) {
Note: See TracChangeset for help on using the changeset viewer.