Skip to content

Commit c2868f9

Browse files
committed
Simplify get_post() and perflab_sanitize_plugin_slug() by removing unnecessary else blocks
1 parent 9bce8c9 commit c2868f9

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

plugins/optimization-detective/storage/class-od-url-metrics-post-type.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,8 @@ public static function get_post( string $slug ): ?WP_Post {
108108
$post = current( $post_query->posts );
109109
if ( $post instanceof WP_Post ) {
110110
return $post;
111-
} else {
112-
return null;
113111
}
112+
return null;
114113
}
115114

116115
/**

plugins/performance-lab/includes/admin/load.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,8 @@ function perflab_enqueue_features_page_scripts(): void {
284284
function perflab_sanitize_plugin_slug( $unsanitized_plugin_slug ): ?string {
285285
if ( in_array( $unsanitized_plugin_slug, perflab_get_standalone_plugins(), true ) ) {
286286
return $unsanitized_plugin_slug;
287-
} else {
288-
return null;
289287
}
288+
return null;
290289
}
291290

292291
/**

0 commit comments

Comments
 (0)