Skip to content

Commit

Permalink
Ignore some false positives by PHPStan related to WP functions in Ale…
Browse files Browse the repository at this point in the history
…rtBox.

See #1167.
  • Loading branch information
boonebgorges committed Sep 14, 2023
1 parent 025f2d7 commit 1364899
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Libraries/AlertBox/The_Alert_Box.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,13 @@ public function dismiss_all_alerts( $page = 0, $post_types = false ) {
if ( current_user_can( 'edit_posts' ) ) {
$q = $this->get_specimens( $page, $post_types );
if ( $q->have_posts() ) {
while ( $q->have_posts() ) : $q->the_post();
while ( $q->have_posts() ) : $q->the_post(); // @phpstan-ignore-line
self::dismiss_alert( get_the_ID() );
endwhile;
} else {
return false;
}
wp_reset_postdata();
wp_reset_postdata(); // @phpstan-ignore-line
return $q->post_count;
} else {
return false;
Expand Down Expand Up @@ -431,12 +431,12 @@ public function alert_box_insides_function() {
if ( self::is_on() ) {
$q = $this->get_specimens();
if ( $q->have_posts() ) {
while ( $q->have_posts() ) : $q->the_post();
while ( $q->have_posts() ) : $q->the_post(); // @phpstan-ignore-line
echo '<p>';
the_alert_box()->the_alert();
echo '</p>';
endwhile;
wp_reset_postdata();
wp_reset_postdata(); // @phpstan-ignore-line
$alertCheck = self::alert_label( 'delete_all_check' );
if ( current_user_can( 'edit_others_posts' ) ) {
$editText = self::alert_label( 'dismiss_all' );
Expand Down

0 comments on commit 1364899

Please sign in to comment.