Skip to content

Commit 65c50f4

Browse files
committed
Coding-Standards & formatting fixes
1 parent 34d46b0 commit 65c50f4

5 files changed

Lines changed: 146 additions & 126 deletions

File tree

admin-notices.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ function sqlite_plugin_admin_notice() {
2727
);
2828
return;
2929
}
30+
3031
/*
3132
* If the SQLITE_DB_DROPIN_VERSION constant is not defined
3233
* but there's a db.php file in the wp-content directory, then the module can't be activated.

admin-page.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
* @package wp-sqlite-integration
77
*/
88

9-
109
/**
1110
* Add an admin menu page.
1211
*

tests/WP_SQLite_Query_Tests.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function setUp(): void {
6464
$err->errorInfo; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
6565
$err_code = $err_data[1];
6666
$translator->rollback();
67-
$message = sprintf(
67+
$message = sprintf(
6868
'Error occurred while creating tables or indexes...<br />Query was: %s<br />',
6969
var_export( $query, true )
7070
);
@@ -479,7 +479,7 @@ public function testRecoverSerialized() {
479479
$this->assertEquals( $obj, $unserialized );
480480

481481
$obj ['two'] ++;
482-
$obj ['pi'] *= 2;
482+
$obj ['pi'] *= 2;
483483
$option_value = serialize( $obj );
484484
$option_value_escaped = $this->engine->get_pdo()->quote( $option_value );
485485
/* Note well: this is heredoc not nowdoc */

tests/WP_SQLite_Translator_Tests.php

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -691,19 +691,18 @@ public function testCaseInsensitiveUniqueIndex() {
691691
$result1 = $this->engine->query( "INSERT INTO _tmp_table (name, lastname) VALUES ('first', 'last');" );
692692
$this->assertEquals( 1, $result1 );
693693

694-
$result1 = $this->engine->query( "SELECT COUNT(*) num FROM _tmp_table;" );
694+
$result1 = $this->engine->query( 'SELECT COUNT(*) num FROM _tmp_table;' );
695695
$this->assertEquals( 1, $result1[0]->num );
696696

697697
// Unique keys should be case-insensitive:
698-
$result2 = $this->assertQuery(
698+
$result2 = $this->assertQuery(
699699
"INSERT INTO _tmp_table (name, lastname) VALUES ('FIRST', 'LAST' );",
700700
'UNIQUE constraint failed'
701701
);
702702

703703
$this->assertEquals( false, $result2 );
704704

705-
706-
$result1 = $this->engine->query( "SELECT COUNT(*) num FROM _tmp_table;" );
705+
$result1 = $this->engine->query( 'SELECT COUNT(*) num FROM _tmp_table;' );
707706
$this->assertEquals( 1, $result1[0]->num );
708707

709708
// Unique keys should be case-insensitive:
@@ -716,21 +715,19 @@ public function testCaseInsensitiveUniqueIndex() {
716715
$result2 = $this->engine->get_query_results();
717716
$this->assertEquals( 0, $result2 );
718717

719-
$result1 = $this->engine->query( "SELECT COUNT(*)num FROM _tmp_table;" );
718+
$result1 = $this->engine->query( 'SELECT COUNT(*)num FROM _tmp_table;' );
720719
$this->assertEquals( 1, $result1[0]->num );
721720

722721
// Unique keys should be case-insensitive:
723-
$result2 = $this->assertQuery(
722+
$result2 = $this->assertQuery(
724723
"INSERT INTO _tmp_table (name, lastname) VALUES ('FIRSTname', 'LASTname' );"
725724
);
726725

727726
$this->assertEquals( 1, $result2 );
728727

729-
730-
$result1 = $this->engine->query( "SELECT COUNT(*) num FROM _tmp_table;" );
728+
$result1 = $this->engine->query( 'SELECT COUNT(*) num FROM _tmp_table;' );
731729
$this->assertEquals( 2, $result1[0]->num );
732730

733-
734731
}
735732

736733
public function testOnDuplicateUpdate() {
@@ -924,12 +921,14 @@ public function testNestedTransactionWorkComplexModify() {
924921
// Behind the scenes, this single MySQL query is split
925922
// into multiple SQLite queries – some of them will
926923
// succeed, some will fail.
927-
$success = $this->engine->query( "
924+
$success = $this->engine->query(
925+
'
928926
ALTER TABLE _options
929927
ADD COLUMN test varchar(20),
930928
ADD COLUMN test varchar(20)
931-
" );
932-
$this->assertFalse($success);
929+
'
930+
);
931+
$this->assertFalse( $success );
933932
// Commit the transaction.
934933
$this->assertQuery( 'COMMIT' );
935934

@@ -964,7 +963,7 @@ public function testNestedTransactionWorkComplexModify() {
964963
'Key' => '',
965964
'Default' => '',
966965
'Extra' => '',
967-
)
966+
),
968967
)
969968
);
970969

@@ -1635,10 +1634,10 @@ public function testCreateTableQuery() {
16351634
$this->assertCount( 1, $rows );
16361635

16371636
$this->assertQuery( 'SELECT SQL_CALC_FOUND_ROWS * FROM wptests_users' );
1638-
$result = $this->assertQuery('SELECT FOUND_ROWS()');
1637+
$result = $this->assertQuery( 'SELECT FOUND_ROWS()' );
16391638
$this->assertEquals(
16401639
array(
1641-
(object)array(
1640+
(object) array(
16421641
'FOUND_ROWS()' => '1',
16431642
),
16441643
),
@@ -1682,7 +1681,7 @@ public function testTranslatesDoubleAlterTable() {
16821681
ADD INDEX test_index2(option_name(140),option_value(51))
16831682
'
16841683
);
1685-
$this->assertEquals('', $this->engine->get_error_message());
1684+
$this->assertEquals( '', $this->engine->get_error_message() );
16861685
$this->assertEquals(
16871686
1,
16881687
$result
@@ -1746,9 +1745,9 @@ public function testTranslatesUtf8Insert() {
17461745
);
17471746
$this->assertCount(
17481747
1,
1749-
$this->assertQuery('SELECT * FROM _options')
1748+
$this->assertQuery( 'SELECT * FROM _options' )
17501749
);
1751-
$this->assertQuery( "DELETE FROM _options");
1750+
$this->assertQuery( 'DELETE FROM _options' );
17521751
}
17531752

17541753
public function testTranslatesRandom() {
@@ -1767,15 +1766,15 @@ public function testTranslatesUtf8SELECT() {
17671766
);
17681767
$this->assertCount(
17691768
1,
1770-
$this->assertQuery('SELECT * FROM _options')
1769+
$this->assertQuery( 'SELECT * FROM _options' )
17711770
);
17721771

17731772
$this->assertQuery(
17741773
"SELECT option_name as 'ą' FROM _options WHERE option_name='ąłółźćę†' AND option_value='ąłółźćę†'"
17751774
);
17761775

17771776
$this->assertEquals(
1778-
array( (object) array( 'ą' => 'ąłółźćę†' )),
1777+
array( (object) array( 'ą' => 'ąłółźćę†' ) ),
17791778
$this->engine->get_query_results()
17801779
);
17811780

@@ -1784,11 +1783,11 @@ public function testTranslatesUtf8SELECT() {
17841783
);
17851784

17861785
$this->assertEquals(
1787-
array( (object) array( 'ą' => 'ąłółźćę†' )),
1786+
array( (object) array( 'ą' => 'ąłółźćę†' ) ),
17881787
$this->engine->get_query_results()
17891788
);
17901789

1791-
$this->assertQuery( "DELETE FROM _options");
1790+
$this->assertQuery( 'DELETE FROM _options' );
17921791
}
17931792

17941793
}

0 commit comments

Comments
 (0)