Skip to content

Commit

Permalink
WPCS.
Browse files Browse the repository at this point in the history
  • Loading branch information
kagg-design committed Sep 15, 2024
1 parent e1745cd commit 6583559
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions uninstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
Expand All @@ -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 );
}
Expand All @@ -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`" );
}

Expand All @@ -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();
}
Expand All @@ -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 );
Expand Down

0 comments on commit 6583559

Please sign in to comment.