Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ includes:
- tests/phpstan/baselines/property.phpDocType.neon
- tests/phpstan/baselines/property.private.neon
- tests/phpstan/baselines/property.protected.neon
- tests/phpstan/baselines/return.missing.neon
- tests/phpstan/baselines/return.type.neon
- tests/phpstan/baselines/return.unusedType.neon
- tests/phpstan/baselines/smallerOrEqual.alwaysTrue.neon
Expand Down
3 changes: 2 additions & 1 deletion src/wp-includes/class-wp-widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ public function update( $new_instance, $old_instance ) {
* @since 2.8.0
*
* @param array $instance The settings for the particular instance of the widget.
* @return string|null Default return is 'noform'. A subclass may opt to return null.
* @return string|void Default return is 'noform'. A subclass which echoes its own
* form returns nothing.
*/
public function form( $instance ) {
echo '<p class="no-options-widget">' . __( 'There are no options for this widget.' ) . '</p>';
Expand Down
49 changes: 31 additions & 18 deletions src/wp-includes/general-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -1673,11 +1673,13 @@ function wp_title( $sep = '&raquo;', $display = true, $seplocation = '' ) {
$title = apply_filters( 'wp_title', $title, $sep, $seplocation );

// Send it out.
if ( $display ) {
echo $title;
} else {
if ( ! $display ) {
return $title;
}

echo $title;

return null;
}

/**
Expand Down Expand Up @@ -1712,11 +1714,14 @@ function single_post_title( $prefix = '', $display = true ) {
* @param WP_Post $_post The current post.
*/
$title = apply_filters( 'single_post_title', $_post->post_title, $_post );
if ( $display ) {
echo $prefix . $title;
} else {

if ( ! $display ) {
return $prefix . $title;
}

echo $prefix . $title;

return null;
}

/**
Expand Down Expand Up @@ -1753,11 +1758,13 @@ function post_type_archive_title( $prefix = '', $display = true ) {
*/
$title = apply_filters( 'post_type_archive_title', $post_type_obj->labels->name, $post_type );

if ( $display ) {
echo $prefix . $title;
} else {
if ( ! $display ) {
return $prefix . $title;
}

echo $prefix . $title;

return null;
}

/**
Expand Down Expand Up @@ -1849,11 +1856,13 @@ function single_term_title( $prefix = '', $display = true ) {
return null;
}

if ( $display ) {
echo $prefix . $term_name;
} else {
if ( ! $display ) {
return $prefix . $term_name;
}

echo $prefix . $term_name;

return null;
}

/**
Expand Down Expand Up @@ -2913,11 +2922,13 @@ function the_date( $format = '', $before = '', $after = '', $display = true ) {
*/
$the_date = apply_filters( 'the_date', $the_date, $format, $before, $after );

if ( $display ) {
echo $the_date;
} else {
if ( ! $display ) {
return $the_date;
}

echo $the_date;

return null;
}

/**
Expand Down Expand Up @@ -2981,11 +2992,13 @@ function the_modified_date( $format = '', $before = '', $after = '', $display =
*/
$the_modified_date = apply_filters( 'the_modified_date', $the_modified_date, $format, $before, $after );

if ( $display ) {
echo $the_modified_date;
} else {
if ( ! $display ) {
return $the_modified_date;
}

echo $the_modified_date;

return null;
}

/**
Expand Down
24 changes: 15 additions & 9 deletions src/wp-includes/link-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -1164,11 +1164,13 @@ function edit_term_link( $link = '', $before = '', $after = '', $term = null, $d
*/
$link = $before . apply_filters( 'edit_term_link', $link, $term->term_id ) . $after;

if ( $display ) {
echo $link;
} else {
if ( ! $display ) {
return $link;
}

echo $link;

return null;
}

/**
Expand Down Expand Up @@ -2547,11 +2549,13 @@ function next_posts( $max_page = 0, $display = true ) {
$link = get_next_posts_page_link( $max_page );
$output = $link ? esc_url( $link ) : '';

if ( $display ) {
echo $output;
} else {
if ( ! $display ) {
return $output;
}

echo $output;

return null;
}

/**
Expand Down Expand Up @@ -2657,11 +2661,13 @@ function previous_posts( $display = true ) {
$link = get_previous_posts_page_link();
$output = $link ? esc_url( $link ) : '';

if ( $display ) {
echo $output;
} else {
if ( ! $display ) {
return $output;
}

echo $output;

return null;
}

/**
Expand Down
155 changes: 0 additions & 155 deletions tests/phpstan/baselines/return.missing.neon

This file was deleted.

Loading