Skip to content

Commit 821cd3e

Browse files
authored
Merge branch 'WordPress:trunk' into trunk
2 parents 199ae6b + 1e521e7 commit 821cd3e

20 files changed

Lines changed: 75 additions & 5 deletions

src/wp-admin/includes/class-custom-background.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,8 @@ public function handle_upload() {
569569
* Media Manager.
570570
*
571571
* @since 4.1.0
572+
*
573+
* @return never
572574
*/
573575
public function ajax_background_add() {
574576
check_ajax_referer( 'background-add', 'nonce' );
@@ -612,6 +614,8 @@ public function filter_upload_tabs( $tabs ) {
612614
/**
613615
* @since 3.4.0
614616
* @deprecated 3.5.0
617+
*
618+
* @return never
615619
*/
616620
public function wp_set_background_image() {
617621
check_ajax_referer( 'custom-background' );

src/wp-admin/includes/class-custom-image-header.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,6 +1383,8 @@ final public function insert_attachment( $attachment, $cropped ) {
13831383
* new object. Returns JSON-encoded object details.
13841384
*
13851385
* @since 3.9.0
1386+
*
1387+
* @return never
13861388
*/
13871389
public function ajax_header_crop() {
13881390
check_ajax_referer( 'image_editor-' . $_POST['id'], 'nonce' );
@@ -1452,6 +1454,8 @@ public function ajax_header_crop() {
14521454
* Media Manager, even if s/he doesn't save that change.
14531455
*
14541456
* @since 3.9.0
1457+
*
1458+
* @return never
14551459
*/
14561460
public function ajax_header_add() {
14571461
check_ajax_referer( 'header-add', 'nonce' );
@@ -1480,6 +1484,8 @@ public function ajax_header_add() {
14801484
* choice in the Customizer's Header tool.
14811485
*
14821486
* @since 3.9.0
1487+
*
1488+
* @return never
14831489
*/
14841490
public function ajax_header_remove() {
14851491
check_ajax_referer( 'header-remove', 'nonce' );

src/wp-admin/includes/class-wp-importer.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,11 @@ public function stop_the_insanity() {
298298
*
299299
* @param string $param The parameter name to retrieve.
300300
* @param bool $required Optional. Whether the parameter is required. Default false.
301-
* @return string|true|null|never The parameter value or true if found, null otherwise.
302-
* The function exits when a required parameter is missing.
301+
* @return string|true|null The parameter value, or true if the parameter was supplied
302+
* without a value, or null if it was not supplied at all.
303+
* Never returns when `$required` is true and the parameter
304+
* is missing, as the function exits instead.
305+
* @phpstan-return ( $required is true ? string|true : string|true|null )
303306
*/
304307
function get_cli_args( $param, $required = false ) {
305308
$args = $_SERVER['argv'];

src/wp-admin/includes/class-wp-list-table.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1843,6 +1843,8 @@ protected function handle_row_actions( $item, $column_name, $primary ) {
18431843
* Handles an incoming ajax request (called from admin-ajax.php)
18441844
*
18451845
* @since 3.1.0
1846+
*
1847+
* @return never
18461848
*/
18471849
public function ajax_response() {
18481850
$this->prepare_items();

src/wp-admin/includes/comment.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ function enqueue_comment_hotkeys_js() {
294294
* @since 2.5.0
295295
*
296296
* @param string $msg Error Message. Assumed to contain HTML and be sanitized.
297+
* @return never
297298
*/
298299
function comment_footer_die( $msg ) {
299300
echo "<div class='wrap'><p>$msg</p></div>";

src/wp-admin/includes/post.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2183,6 +2183,7 @@ function wp_autosave( $post_data ) {
21832183
* @since 2.7.0
21842184
*
21852185
* @param int $post_id Optional. Post ID.
2186+
* @return never
21862187
*/
21872188
function redirect_post( $post_id = 0 ) {
21882189
if ( isset( $_POST['save'] ) || isset( $_POST['publish'] ) ) {

src/wp-admin/includes/theme-install.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,8 @@ function display_themes() {
251251
* @since 2.8.0
252252
*
253253
* @global WP_Theme_Install_List_Table $wp_list_table
254+
*
255+
* @return never
254256
*/
255257
function install_theme_information() {
256258
global $wp_list_table;

src/wp-includes/canonical.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
* figure if redirect is needed.
3939
* @param bool $do_redirect Optional. Redirect to the new URL.
4040
* @return string|null The string of the URL, if redirect needed. Never returns if a redirect occurs, depending on $do_redirect.
41+
* @phpstan-return ( $do_redirect is true ? null : string|null )
4142
*/
4243
function redirect_canonical( $requested_url = null, $do_redirect = true ) {
4344
global $wp_rewrite, $is_IIS, $wp_query, $wpdb, $wp;

src/wp-includes/class-wp-ajax-response.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ public function add( $args = '' ) {
148148
* Sets the content type header to text/xml.
149149
*
150150
* @since 2.1.0
151+
*
152+
* @return never
151153
*/
152154
public function send() {
153155
header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ) );

src/wp-includes/class-wp-customize-manager.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ public function doing_ajax( $action = null ) {
447447
*
448448
* @param string|WP_Error $ajax_message Ajax return.
449449
* @param string $message Optional. UI message.
450+
* @return never
450451
*/
451452
protected function wp_die( $ajax_message, $message = null ) {
452453
if ( $this->doing_ajax() ) {
@@ -2427,6 +2428,8 @@ public function prepare_setting_validity_for_js( $validity ) {
24272428
*
24282429
* @since 3.4.0
24292430
* @since 4.7.0 The semantics of this method have changed to update a changeset, optionally to also change the status and other attributes.
2431+
*
2432+
* @return never
24302433
*/
24312434
public function save() {
24322435
if ( ! is_user_logged_in() ) {
@@ -3386,6 +3389,8 @@ public function check_changeset_lock_with_heartbeat( $response, $data, $screen_i
33863389
* Removes changeset lock when take over request is sent via Ajax.
33873390
*
33883391
* @since 4.9.0
3392+
*
3393+
* @return never
33893394
*/
33903395
public function handle_override_changeset_lock_request() {
33913396
if ( ! $this->is_preview() ) {
@@ -3685,6 +3690,8 @@ protected function update_stashed_theme_mod_settings( $inactive_theme_mod_settin
36853690
* Refreshes nonces for the current preview.
36863691
*
36873692
* @since 4.2.0
3693+
*
3694+
* @return never
36883695
*/
36893696
public function refresh_nonces() {
36903697
if ( ! $this->is_preview() ) {
@@ -3698,6 +3705,8 @@ public function refresh_nonces() {
36983705
* Deletes a given auto-draft changeset or the autosave revision for a given changeset or delete changeset lock.
36993706
*
37003707
* @since 4.9.0
3708+
*
3709+
* @return never
37013710
*/
37023711
public function handle_dismiss_autosave_or_lock_request() {
37033712
// Calls to dismiss_user_auto_draft_changesets() and wp_get_post_autosave() require non-zero get_current_user_id().
@@ -5824,6 +5833,8 @@ public function register_dynamic_settings() {
58245833
* Loads themes into the theme browsing/installation UI.
58255834
*
58265835
* @since 4.9.0
5836+
*
5837+
* @return never
58275838
*/
58285839
public function handle_load_themes_request() {
58295840
check_ajax_referer( 'switch_themes', 'nonce' );

0 commit comments

Comments
 (0)