From 0e42a12a33b9bb193fa7851628edf018bd922362 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sat, 18 Jun 2022 11:38:26 +0200 Subject: Add phpcs config and do automatic fixups. --- includes/admin/register_db_tables.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'includes/admin/register_db_tables.php') diff --git a/includes/admin/register_db_tables.php b/includes/admin/register_db_tables.php index ce0f25c..5f83e25 100644 --- a/includes/admin/register_db_tables.php +++ b/includes/admin/register_db_tables.php @@ -4,16 +4,14 @@ // // SPDX-License-Identifier: AGPL-3.0-or-later -if ( !function_exists( "giglog_register_db_tables") ) -{ +if ( ! function_exists( 'giglog_register_db_tables' ) ) { /** * Registers the tables used by the GiglogAdmin plugin */ - function giglog_register_db_tables() : void - { + function giglog_register_db_tables() : void { global $wpdb; - $tables = []; + $tables = array(); $tables[] = "CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}giglogadmin_venues` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -45,11 +43,10 @@ if ( !function_exists( "giglog_register_db_tables") ) REFERENCES `{$wpdb->prefix}giglogadmin_venues` (`id`) ON DELETE NO ACTION ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"; - - foreach($tables as $tabledef) { - $result = $wpdb->query($tabledef); - if ($result === false) { - error_log("Registering table failed."); + foreach ( $tables as $tabledef ) { + $result = $wpdb->query( $tabledef ); + if ( $result === false ) { + error_log( 'Registering table failed.' ); } } } -- cgit v1.2.3