Skip to content

Commit 8d20e71

Browse files
committed
fix linting error
1 parent bbd9e5a commit 8d20e71

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

src/wp-admin/includes/plugin.php

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,31 +1116,34 @@ function validate_active_plugins() {
11161116
function safe_plugin_activation_check( $plugin_file ) {
11171117
ob_start();
11181118

1119-
$previous_handler = set_error_handler(function($severity, $message, $file, $line) {
1120-
throw new ErrorException($message, 0, $severity, $file, $line);
1121-
});
1119+
$previous_handler = set_error_handler(
1120+
function ( $severity, $message, $file, $line ) {
1121+
throw new ErrorException( $message, 0, $severity, $file, $line );
1122+
}
1123+
);
11221124

11231125
try {
11241126
include_once WP_PLUGIN_DIR . '/' . $plugin_file;
11251127
ob_end_clean();
11261128

1127-
if ( $previous_handler !== null ) {
1129+
if ( null !== $previous_handler ) {
11281130
restore_error_handler();
11291131
}
11301132

11311133
return true;
11321134

1133-
} catch (ParseError $e) {
1135+
} catch ( ParseError $e ) {
11341136
ob_end_clean();
11351137

1136-
if ( $previous_handler !== null ) {
1138+
if ( null !== $previous_handler ) {
11371139
restore_error_handler();
11381140
}
11391141

11401142
return new WP_Error(
11411143
'plugin_parse_error',
11421144
sprintf(
1143-
__('Plugin activation failed due to syntax error: %s'),
1145+
/* translators: %s: The error message returned when a plugin fails to activate due to syntax errors. */
1146+
__( 'Plugin activation failed due to syntax error: %s' ),
11441147
$e->getMessage()
11451148
),
11461149
array(
@@ -1149,17 +1152,18 @@ function safe_plugin_activation_check( $plugin_file ) {
11491152
)
11501153
);
11511154

1152-
} catch (Throwable $e) {
1155+
} catch ( Throwable $e ) {
11531156
ob_end_clean();
11541157

1155-
if ( $previous_handler !== null ) {
1158+
if ( null !== $previous_handler ) {
11561159
restore_error_handler();
11571160
}
11581161

11591162
return new WP_Error(
11601163
'plugin_activation_exception',
11611164
sprintf(
1162-
__('Plugin activation failed with exception: %s'),
1165+
/* translators: %s: The exception message returned when a plugin fails to activate. */
1166+
__( 'Plugin activation failed with exception: %s' ),
11631167
$e->getMessage()
11641168
),
11651169
array(

0 commit comments

Comments
 (0)