Skip to content
Open
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
2 changes: 0 additions & 2 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ includes:
- tests/phpstan/baselines/ternary.alwaysTrue.neon
- tests/phpstan/baselines/varTag.noVariable.neon
- tests/phpstan/baselines/variable.undefined.neon
- tests/phpstan/baselines/while.alwaysFalse.neon
- tests/phpstan/baselines/while.alwaysTrue.neon
# phpstan:baselines end

parameters:
Expand Down
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentyfourteen/inc/widgets.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ public function widget( $args, $instance ) {
if ( $ephemera->have_posts() ) :
$tmp_content_width = $GLOBALS['content_width'];
$GLOBALS['content_width'] = 306;
$tmp_more = $GLOBALS['more'];

echo $args['before_widget'];
?>
Expand All @@ -148,7 +149,6 @@ public function widget( $args, $instance ) {
<?php
while ( $ephemera->have_posts() ) :
$ephemera->the_post();
$tmp_more = $GLOBALS['more'];
$GLOBALS['more'] = 0;
?>
<li>
Expand Down
4 changes: 4 additions & 0 deletions src/wp-includes/class-wp-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -3839,6 +3839,8 @@ function ( $carry, $post ) {
*
* @since 1.5.0
*
* @phpstan-impure
*
* @return bool True if posts are available, false if end of the loop.
*/
public function have_posts() {
Expand Down Expand Up @@ -3929,6 +3931,8 @@ public function the_comment() {
*
* @since 2.2.0
*
* @phpstan-impure
*
* @return bool True if comments are available, false if no more comments.
*/
public function have_comments() {
Expand Down
4 changes: 4 additions & 0 deletions src/wp-includes/query.php
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,8 @@ function is_main_query() {
*
* @global WP_Query $wp_query WordPress Query object.
*
* @phpstan-impure
*
* @return bool True if posts are available, false if end of the loop.
*/
function have_posts() {
Expand Down Expand Up @@ -1036,6 +1038,8 @@ function the_post() {
*
* @global WP_Query $wp_query WordPress Query object.
*
* @phpstan-impure
*
* @return bool True if comments are available, false if no more comments.
*/
function have_comments() {
Expand Down
230 changes: 0 additions & 230 deletions tests/phpstan/baselines/deadCode.unreachable.neon
Original file line number Diff line number Diff line change
Expand Up @@ -38,241 +38,11 @@ parameters:
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-admin/includes/class-wp-internal-pointers.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 2
path: ../../../src/wp-admin/includes/dashboard.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 2
path: ../../../src/wp-admin/post.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentyeleven/archive.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentyeleven/author.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentyeleven/category.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentyeleven/inc/widgets.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentyeleven/index.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentyeleven/search.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentyeleven/showcase.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentyeleven/tag.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentyfifteen/archive.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentyfifteen/index.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentyfifteen/search.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentyfourteen/archive.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentyfourteen/author.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentyfourteen/category.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentyfourteen/inc/widgets.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentyfourteen/index.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentyfourteen/search.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentyfourteen/tag.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentyfourteen/taxonomy-post_format.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentynineteen/archive.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentynineteen/index.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentynineteen/search.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentyseventeen/archive.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentyseventeen/index.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentyseventeen/search.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentyseventeen/template-parts/page/content-front-page-panels.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentysixteen/archive.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentysixteen/index.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentysixteen/search.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentythirteen/archive.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentythirteen/author.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentythirteen/category.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentythirteen/index.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentythirteen/search.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentythirteen/tag.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentythirteen/taxonomy-post_format.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentytwelve/archive.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentytwelve/author.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentytwelve/category.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentytwelve/index.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentytwelve/search.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentytwelve/tag.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentytwentyone/archive.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentytwentyone/index.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-content/themes/twentytwentyone/search.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
Expand Down
5 changes: 0 additions & 5 deletions tests/phpstan/baselines/if.alwaysTrue.neon
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ parameters:
identifier: if.alwaysTrue
count: 2
path: ../../../src/wp-admin/upload.php
-
message: '#^If condition is always true\.$#'
identifier: if.alwaysTrue
count: 1
path: ../../../src/wp-content/themes/twentynineteen/comments.php
-
message: '#^If condition is always true\.$#'
identifier: if.alwaysTrue
Expand Down
25 changes: 0 additions & 25 deletions tests/phpstan/baselines/while.alwaysFalse.neon

This file was deleted.

Loading
Loading