Make WordPress Core

Changeset 61716


Ignore:
Timestamp:
02/23/2026 05:33:24 AM (8 months ago)
Author:
westonruter
Message:

Code Quality: Explicitly return null when documented instead of void.

This fixes a PHPStan rule level 3 error: return.empty.

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

Props huzaifaalmesbah, westonruter, shailu25, mukesh27, noruzzaman.
See #64238.

Location:
trunk/src
Files:
4 edited

Legend:

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

    r61611 r61716  
    21882188
    21892189                if ( ! file_exists( $abstraction_file ) ) {
    2190                         return;
     2190                        return null;
    21912191                }
    21922192
  • trunk/src/wp-admin/includes/plugin.php

    r61470 r61716  
    927927                        exit;
    928928                }
    929                 return;
     929                return null;
    930930        }
    931931
    … …  
    942942                        exit;
    943943                }
    944                 return;
     944                return null;
    945945        }
    946946
  • trunk/src/wp-admin/includes/theme.php

    r61463 r61716  
    4141                        exit;
    4242                }
    43                 return;
     43                return null;
    4444        }
    4545
    … …  
    5656                        exit;
    5757                }
    58                 return;
     58                return null;
    5959        }
    6060
  • trunk/src/wp-includes/category.php

    r59704 r61716  
    145145
    146146        if ( empty( $categories ) ) {
    147                 return;
     147                return null;
    148148        }
    149149
Note: See TracChangeset for help on using the changeset viewer.