Skip to content

Commit f7fc236

Browse files
committed
Remove unnecessary returns now covered by bail returning never
1 parent 88e05dd commit f7fc236

2 files changed

Lines changed: 1 addition & 9 deletions

File tree

‎src/wp-includes/html-api/class-wp-html-processor.php‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3358,8 +3358,6 @@ private function step_in_body(): bool {
33583358
}
33593359

33603360
$this->bail( 'Should not have been able to reach end of IN BODY processing. Check HTML API code.' );
3361-
// This unnecessary return prevents tools from inaccurately reporting type errors.
3362-
return false;
33633361
}
33643362

33653363
/**
@@ -3408,8 +3406,6 @@ private function in_body_any_other_end_tag(): bool {
34083406
}
34093407

34103408
$this->bail( 'Should not have been able to reach end of "any other end tag" IN BODY processing. Check HTML API code.' );
3411-
// This unnecessary return prevents tools from inaccurately reporting type errors.
3412-
return false;
34133409
}
34143410

34153411
/**
@@ -5086,8 +5082,6 @@ private function step_in_foreign_content(): bool {
50865082
}
50875083

50885084
$this->bail( 'Should not have been able to reach end of IN FOREIGN CONTENT processing. Check HTML API code.' );
5089-
// This unnecessary return prevents tools from inaccurately reporting type errors.
5090-
return false;
50915085
}
50925086

50935087
/*
@@ -6375,8 +6369,6 @@ private function is_html_integration_point(): bool {
63756369
}
63766370

63776371
$this->bail( 'Should not have reached end of HTML Integration Point detection: check HTML API code.' );
6378-
// This unnecessary return prevents tools from inaccurately reporting type errors.
6379-
return false;
63806372
}
63816373

63826374
/**

‎tests/phpstan/baselines/deadCode.unreachable.neon‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ parameters:
5656
-
5757
message: '#^Unreachable statement \- code above always terminates\.$#'
5858
identifier: deadCode.unreachable
59-
count: 18
59+
count: 16
6060
path: ../../../src/wp-includes/html-api/class-wp-html-processor.php
6161
-
6262
message: '#^Unreachable statement \- code above always terminates\.$#'

0 commit comments

Comments
 (0)