Skip to content

Commit

Permalink
Remove unreachable else clauses.
Browse files Browse the repository at this point in the history
The `$return_var` variable in these cases is forced to `false`.

See #1167.
  • Loading branch information
boonebgorges committed Sep 14, 2023
1 parent 122982b commit 551de03
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
6 changes: 1 addition & 5 deletions Core/API/MetaCheckEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,7 @@ public function register_routes() {
} catch ( \DomainException $e ) {
$return_var = new WP_Error( 'auth_fail_ssl', __( 'SSL cannot be applied to the key.', 'pressforward' ) );
} catch ( \Exception $e ) {
if ( false === $return_var ) {
return new WP_Error( 'auth_fail_whoknows', __( 'Authentication failed for reasons unclear.', 'pressforward' ) );
} else {
return $return_var;
}
return new WP_Error( 'auth_fail_whoknows', __( 'Authentication failed for reasons unclear.', 'pressforward' ) );
}
},
'priority' => 10,
Expand Down
12 changes: 2 additions & 10 deletions Core/API/NominateThisEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,7 @@ public function register_routes() {
} catch ( \DomainException $e ) {
$return_var = new WP_Error( 'auth_fail_ssl', __( 'SSL cannot be applied to the key.', 'pressforward' ) );
} catch ( \Exception $e ) {
if ( false === $return_var ) {
return new WP_Error( 'auth_fail_whoknows', __( 'Authentication failed for reasons unclear.', 'pressforward' ) );
} else {
return $return_var;
}
return new WP_Error( 'auth_fail_whoknows', __( 'Authentication failed for reasons unclear.', 'pressforward' ) );
}
},
'priority' => 10,
Expand Down Expand Up @@ -288,11 +284,7 @@ public function register_routes() {
} catch ( \DomainException $e ) {
$return_var = new WP_Error( 'auth_fail_ssl', __( 'SSL cannot be applied to the key.', 'pressforward' ) );
} catch ( \Exception $e ) {
if ( false === $return_var ) {
return new WP_Error( 'auth_fail_whoknows', __( 'Authentication failed for reasons unclear.', 'pressforward' ) );
} else {
return $return_var;
}
return new WP_Error( 'auth_fail_whoknows', __( 'Authentication failed for reasons unclear.', 'pressforward' ) );
}
return $return_var;
},
Expand Down

0 comments on commit 551de03

Please sign in to comment.