Skip to content

Commit cd1149a

Browse files
committed
docs: add never|void return type to wp_die()
1 parent 03b4080 commit cd1149a

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

phpstan.neon.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ parameters:
1919

2020
ignoreErrors:
2121
# Level 0:
22-
- # Inner functions arent supported by PHPstan.
22+
- # Inner functions aren't supported by PHPStan.
2323
message: '#Function wxr_[a-z_]+ not found#'
2424
path: src/wp-admin/includes/export.php
2525
-

src/wp-includes/functions.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3765,6 +3765,10 @@ function wp_nonce_ays( $action ) {
37653765
* is a WP_Error.
37663766
* @type bool $exit Whether to exit the process after completion. Default true.
37673767
* }
3768+
*
3769+
* @return never|void Returns false if `$args['exit']` is false, otherwise exists.
3770+
*
3771+
* @phpstan-return ($args['exit'] is false ? void : never)
37683772
*/
37693773
function wp_die( $message = '', $title = '', $args = array() ) {
37703774
global $wp_query;

0 commit comments

Comments
 (0)