Skip to content

Commit

Permalink
Remove duplicate code.
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-vlasenko authored and Anton Vlasenko committed Apr 8, 2024
1 parent aed56d2 commit 7a0bd41
Showing 1 changed file with 0 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,18 +157,6 @@ protected function process_hook( File $phpcs_file, $stack_pointer ) {

list( $doc_block_start_token, $doc_block_end_token ) = $docblock;

$version_token = static::parse_since_tags( $phpcs_file, $doc_block_start_token, $doc_block_end_token );
if ( false === $version_token ) {
$docblock_content = GetTokensAsString::compact( $phpcs_file, $doc_block_start_token, $doc_block_end_token, false );
if ( false !== stripos( $docblock_content, 'This filter is documented in ' ) ) {
// The hook is documented elsewhere.
return;
}

$phpcs_file->addError( $missing_since_tag_error_message, $stack_pointer, $violation_code );
return;
}

$version_tags = static::parse_since_tags( $phpcs_file, $doc_block_start_token, $doc_block_end_token );
if ( empty( $version_tags ) ) {
$docblock_content = GetTokensAsString::compact( $phpcs_file, $doc_block_start_token, $doc_block_end_token, false );
Expand Down

0 comments on commit 7a0bd41

Please sign in to comment.