Aşağıdaki kodlar için PhpStorm şu iki uyarıyı veriyor;
1. satırı göstererek: Duplicated code fragment (20 lines long)
2. satırı göstererek: 'if' statement with common parts
Tam olarak ne demek sitediğini anlamadım?
echo '<article id="post-0" class="post no-results not-found">';
if ( current_user_can( 'edit_posts' ) ) {
// Show a different message to a logged-in user who can add posts.
echo '<header class="entry-header">
<h1 class="title">'; _e( 'No posts to display', 'laura' ); echo '</h1>
</header>
<div class="entry-content">
<p>'; printf( __( 'Ready to publish your first post? <a href="%s">Get started here</a>.', 'laura' ), admin_url( 'post-new.php' ) ); echo '</p>
</div>';
} else {
// Show the default message to everyone else.
echo '<header class="entry-header">
<h1 class="title">'; _e( 'Nothing Found', 'laura' ); echo '</h1>
</header>
<div class="entry-content">
<p>'; _e( 'Kindly search your topic below or browse the recent posts.', 'laura' ); echo '</p>';
get_search_form();
echo '</div>';
} // end current_user_can() check
echo '</article>';
} // end have_posts() check