Skip to content

Commit e4e1bbd

Browse files
committed
Fix PHPCS code style violations
One argument per line in the sprintf call, align equals signs, and use single quotes for CREATE TABLE string in tests.
1 parent 8c6600f commit e4e1bbd

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

tests/WP_SQLite_Driver_Tests.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2436,10 +2436,10 @@ public function testZeroDateAcceptedForDateColumn() {
24362436
$this->assertQuery( "SET sql_mode = 'STRICT_TRANS_TABLES'" );
24372437

24382438
$this->assertQuery(
2439-
"CREATE TABLE _date_test (
2439+
'CREATE TABLE _date_test (
24402440
ID INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL,
24412441
col_date DATE NOT NULL
2442-
);"
2442+
);'
24432443
);
24442444

24452445
$this->assertQuery( "INSERT INTO _date_test (col_date) VALUES ('0000-00-00');" );

wp-includes/sqlite-ast/class-wp-pdo-mysql-on-sqlite.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5689,7 +5689,7 @@ private function cast_value_for_saving(
56895689
* - Enabled without strict mode: zero-part dates produce a warning and are stored as '0000-00-00'.
56905690
* - Enabled with strict mode: zero-part dates produce an error.
56915691
*/
5692-
$reject_zero_date = (
5692+
$reject_zero_date = (
56935693
$this->is_sql_mode_active( 'NO_ZERO_DATE' ) && $is_strict_mode
56945694
) ? 1 : 0;
56955695
$reject_zero_in_date = $this->is_sql_mode_active( 'NO_ZERO_IN_DATE' ) ? 1 : 0;
@@ -5706,9 +5706,16 @@ private function cast_value_for_saving(
57065706
ELSE %s
57075707
END",
57085708
$translated_value,
5709-
$translated_value, $reject_zero_date, $zero_date_value,
5710-
$translated_value, $translated_value, $translated_value, $reject_zero_in_date, $translated_value,
5711-
$function_call, $function_call,
5709+
$translated_value,
5710+
$reject_zero_date,
5711+
$zero_date_value,
5712+
$translated_value,
5713+
$translated_value,
5714+
$translated_value,
5715+
$reject_zero_in_date,
5716+
$translated_value,
5717+
$function_call,
5718+
$function_call,
57125719
$fallback
57135720
);
57145721
default:

0 commit comments

Comments
 (0)