-
Notifications
You must be signed in to change notification settings - Fork 128
Eliminate usage of empty()
construct
#1803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f6a89b1
7e480ca
50a6d78
70e55e4
9a85740
48c1669
2766d04
854f641
87f4abf
375a1ed
2a631f1
e12a0f7
32f794c
717483d
69bd65c
2117f92
dc42328
2a93cf4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -209,7 +209,7 @@ static function ( $value ) { | |
*/ | ||
public function use_output_buffer(): bool { | ||
$options = (array) get_option( PERFLAB_SERVER_TIMING_SETTING, array() ); | ||
$enabled = ! empty( $options['output_buffering'] ); | ||
$enabled = isset( $options['output_buffering'] ) && (bool) $options['output_buffering']; | ||
|
||
/** | ||
* Filters whether an output buffer should be used to be able to gather additional Server-Timing metrics. | ||
|
@@ -220,7 +220,7 @@ public function use_output_buffer(): bool { | |
* | ||
* @since 1.8.0 | ||
* | ||
* @param bool $use_output_buffer Whether to use an output buffer. | ||
* @param bool $enabled Whether to use an output buffer. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch. |
||
*/ | ||
return (bool) apply_filters( 'perflab_server_timing_use_output_buffer', $enabled ); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,7 +63,7 @@ function perflab_aao_handle_update_autoload(): void { | |
wp_die( esc_html__( 'Permission denied.', 'performance-lab' ) ); | ||
} | ||
|
||
if ( empty( $option_name ) ) { | ||
if ( '' === $option_name ) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If someone passed an I don't think this is a problem here though 😄 |
||
wp_die( esc_html__( 'Invalid option name.', 'performance-lab' ) ); | ||
} | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.