From 963fc04f43df753cc91f531e643e653734c538ce Mon Sep 17 00:00:00 2001 From: Jeroen Pfeil Date: Fri, 19 Jul 2024 22:20:40 +0700 Subject: [PATCH] Ignore some linting issues --- src/WP_SQLite_Base.php | 6 +++--- src/WP_SQLite_Export.php | 1 + src/WP_SQLite_Import.php | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/WP_SQLite_Base.php b/src/WP_SQLite_Base.php index ff4e5d16..c2435dea 100644 --- a/src/WP_SQLite_Base.php +++ b/src/WP_SQLite_Base.php @@ -28,15 +28,15 @@ protected function load_dependencies() { // Load the translator class from the plugin. if ( ! defined( 'SQLITE_DB_DROPIN_VERSION' ) ) { - define( 'SQLITE_DB_DROPIN_VERSION', self::get_sqlite_version() ); + define( 'SQLITE_DB_DROPIN_VERSION', self::get_sqlite_version() ); // phpcs:ignore } # A hack to add the do_action and apply_filters functions to the global namespace. # This is necessary because during the import WP has not been loaded, and we # need to define these functions to avoid fatal errors. if ( ! function_exists( 'do_action' ) ) { - function do_action() {} - function apply_filters() {} + function do_action() {} // phpcs:ignore + function apply_filters() {} // phpcs:ignore } // We also need to selectively load the necessary classes from the plugin. diff --git a/src/WP_SQLite_Export.php b/src/WP_SQLite_Export.php index d46b6eab..c7a451f5 100644 --- a/src/WP_SQLite_Export.php +++ b/src/WP_SQLite_Export.php @@ -76,6 +76,7 @@ protected function get_create_statement( $table, $translator ) { protected function get_insert_statements( $table, $pdo ) { $stmt = $pdo->prepare( 'SELECT * FROM ' . $table->name ); $stmt->execute(); + // phpcs:ignore while ( $row = $stmt->fetch( PDO::FETCH_ASSOC, PDO::FETCH_ORI_NEXT ) ) { yield sprintf( 'INSERT INTO `%1s` VALUES (%2s);', $table->name, $this->escape_values( $pdo, $row ) ); } diff --git a/src/WP_SQLite_Import.php b/src/WP_SQLite_Import.php index e8905f2d..27dd537a 100644 --- a/src/WP_SQLite_Import.php +++ b/src/WP_SQLite_Import.php @@ -45,6 +45,7 @@ public function parse_statements( $sql_file_path ) { $in_comment = false; $buffer = ''; + // phpcs:ignore while ( ( $line = fgets( $handle ) ) !== false ) { $line = trim( $line );