From 6583559ff1846234cb0834f301c328270c3fcb44 Mon Sep 17 00:00:00 2001 From: kagg-design Date: Sun, 15 Sep 2024 18:42:05 +0300 Subject: [PATCH] WPCS. --- uninstall.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/uninstall.php b/uninstall.php index d8413895..58905a17 100644 --- a/uninstall.php +++ b/uninstall.php @@ -26,7 +26,7 @@ * * @return void */ -function hcap_delete_site_meta_options( array $options ) { +function hcap_delete_site_meta_options( array $options ): void { foreach ( $options as $option ) { delete_site_option( $option ); } @@ -39,7 +39,7 @@ function hcap_delete_site_meta_options( array $options ) { * * @return void */ -function hcap_delete_options( array $options ) { +function hcap_delete_options( array $options ): void { foreach ( $options as $option ) { delete_option( $option ); } @@ -50,9 +50,10 @@ function hcap_delete_options( array $options ) { * * @return void */ -function hcap_delete_events_table() { +function hcap_delete_events_table(): void { global $wpdb; + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.SchemaChange $wpdb->query( "DROP TABLE IF EXISTS `{$wpdb->prefix}hcaptcha_events`" ); } @@ -63,7 +64,7 @@ function hcap_delete_events_table() { * * @return void */ -function hcap_cleanup_site_data( array $options ) { +function hcap_cleanup_site_data( array $options ): void { hcap_delete_options( $options ); hcap_delete_events_table(); } @@ -74,7 +75,7 @@ function hcap_cleanup_site_data( array $options ) { * @return void * @noinspection DisconnectedForeachInstructionInspection */ -function hcap_cleanup_data() { +function hcap_cleanup_data(): void { $settings = [ PluginSettingsBase::OPTION_NAME, PluginSettingsBase::OPTION_NAME . SettingsBase::NETWORK_WIDE ]; $other = [ LoginBase::LOGIN_DATA, Migrations::MIGRATED_VERSIONS_OPTION_NAME ]; $all_options = array_merge( $settings, $other );