Skip to content

Commit 614a8f4

Browse files
committed
PHPStan: add @phpstan-ignore if.alwaysTrue annotations
1 parent 20efde6 commit 614a8f4

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/wp-admin/my-sites.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@
138138

139139
$actions = "<a href='" . esc_url( home_url() ) . "'>" . __( 'Visit' ) . '</a>';
140140

141+
// @phpstan-ignore if.alwaysTrue (Capabilities are site-specific)
141142
if ( current_user_can( 'read' ) ) {
142143
$actions .= " | <a href='" . esc_url( admin_url() ) . "'>" . __( 'Dashboard' ) . '</a>';
143144
}

src/wp-admin/upload.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ function () {
210210
<h1 class="wp-heading-inline"><?php echo esc_html( $title ); ?></h1>
211211

212212
<?php
213+
// @phpstan-ignore if.alwaysTrue (Confidence check in case the file is required instead of accessed)
213214
if ( current_user_can( 'upload_files' ) ) {
214215
?>
215216
<a href="<?php echo esc_url( admin_url( 'media-new.php' ) ); ?>" class="page-title-action aria-button-if-js"><?php echo esc_html__( 'Add Media File' ); ?></a>
@@ -417,10 +418,11 @@ function () {
417418
<h1 class="wp-heading-inline"><?php echo esc_html( $title ); ?></h1>
418419

419420
<?php
421+
// @phpstan-ignore if.alwaysTrue (Confidence check in case the file is required instead of accessed)
420422
if ( current_user_can( 'upload_files' ) ) {
421423
?>
422424
<a href="<?php echo esc_url( admin_url( 'media-new.php' ) ); ?>" class="page-title-action"><?php echo esc_html__( 'Add Media File' ); ?></a>
423-
<?php
425+
<?php
424426
}
425427

426428
if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {

0 commit comments

Comments
 (0)