Skip to content

Commit

Permalink
Linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrgicak committed May 17, 2024
1 parent 42e75c0 commit 7973d69
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions tests/WP_SQLite_Query_Tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -506,16 +506,17 @@ public function testRecoverSerialized() {
}

public function testOnDuplicateKey() {
$this->assertQuery("
CREATE TABLE `test` (
$this->assertQuery(
'CREATE TABLE `test` (
`id` INT PRIMARY KEY,
`text` VARCHAR(255),
);
");
);'
);
// The order is deliberate to test that the query works with the keys in any order.
$this->assertQuery( "INSERT INTO test (`text`, `id`)
VALUES ('test', 1)
ON DUPLICATE KEY UPDATE `text` = 'test1'"
$this->assertQuery(
'INSERT INTO test (`text`, `id`)
VALUES ("test", 1)
ON DUPLICATE KEY UPDATE `text` = "test1"'
);
}

Expand Down
2 changes: 1 addition & 1 deletion wp-includes/sqlite/class-wp-sqlite-translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2803,7 +2803,7 @@ private function translate_on_duplicate_key( $table_name ) {
$this->rewriter->add( new WP_SQLite_Token( '(', WP_SQLite_Token::TYPE_OPERATOR ) );

$max = count( $conflict_columns );
$i = 0;
$i = 0;
foreach ( $conflict_columns as $conflict_column ) {
$this->rewriter->add( new WP_SQLite_Token( '"' . $conflict_column . '"', WP_SQLite_Token::TYPE_KEYWORD, WP_SQLite_Token::FLAG_KEYWORD_KEY ) );
if ( ++$i < $max ) {
Expand Down

0 comments on commit 7973d69

Please sign in to comment.