Skip to content

Commit 2848245

Browse files
committed
Improve placement and formatting of phpstan-return
1 parent 3d0b3e9 commit 2848245

1 file changed

Lines changed: 8 additions & 2 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 ] ) ) {

0 commit comments

Comments
 (0)