Skip to content

Commit 77d9403

Browse files
committed
Improve placement and formatting of phpstan-return
1 parent cc01268 commit 77d9403

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

src/wp-includes/class-wp-theme.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -864,10 +864,16 @@ public function cache_delete() {
864864
*
865865
* @since 3.4.0
866866
*
867-
* @phpstan-return ( $header is 'Tags' ? string[]|false : ( $header is 'Name'|'ThemeURI'|'Description'|'Author'|'AuthorURI'|'Version'|'Template'|'Status'|'TextDomain'|'DomainPath'|'RequiresWP'|'RequiresPHP'|'UpdateURI' ? string|false : mixed ) )
868-
*
869867
* @param string $header Theme header. Name, Description, Author, Version, ThemeURI, AuthorURI, Status, Tags.
870868
* @return string|array|false String or array (for Tags header) on success, false on failure.
869+
*
870+
* @phpstan-return (
871+
* $header is 'Tags'
872+
* ? string[]|false
873+
* : ( $header is 'Name'|'ThemeURI'|'Description'|'Author'|'AuthorURI'|'Version'|'Template'|'Status'|'TextDomain'|'DomainPath'|'RequiresWP'|'RequiresPHP'|'UpdateURI'
874+
* ? string|false
875+
* : false )
876+
* )
871877
*/
872878
public function get( $header ) {
873879
if ( ! isset( $this->headers[ $header ] ) ) {

src/wp-includes/functions.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3765,10 +3765,9 @@ 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-
*
37693768
* @return never|void Returns false if `$args['exit']` is false, otherwise exits.
37703769
*
3771-
* @phpstan-return ($args['exit'] is false ? void : never)
3770+
* @phpstan-return ( $args['exit'] is false ? void : never )
37723771
*/
37733772
function wp_die( $message = '', $title = '', $args = array() ) {
37743773
global $wp_query;

0 commit comments

Comments
 (0)