Skip to content

Commit 025b03d

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 e962cdf commit 025b03d

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
@@ -5696,7 +5696,7 @@ private function cast_value_for_saving(
56965696
* - Enabled without strict mode: zero-part dates produce a warning and are stored as '0000-00-00'.
56975697
* - Enabled with strict mode: zero-part dates produce an error.
56985698
*/
5699-
$reject_zero_date = (
5699+
$reject_zero_date = (
57005700
$this->is_sql_mode_active( 'NO_ZERO_DATE' ) && $is_strict_mode
57015701
) ? 1 : 0;
57025702
$reject_zero_in_date = $this->is_sql_mode_active( 'NO_ZERO_IN_DATE' ) ? 1 : 0;
@@ -5713,9 +5713,16 @@ private function cast_value_for_saving(
57135713
ELSE %s
57145714
END",
57155715
$translated_value,
5716-
$translated_value, $reject_zero_date, $zero_date_value,
5717-
$translated_value, $translated_value, $translated_value, $reject_zero_in_date, $translated_value,
5718-
$function_call, $function_call,
5716+
$translated_value,
5717+
$reject_zero_date,
5718+
$zero_date_value,
5719+
$translated_value,
5720+
$translated_value,
5721+
$translated_value,
5722+
$reject_zero_in_date,
5723+
$translated_value,
5724+
$function_call,
5725+
$function_call,
57195726
$fallback
57205727
);
57215728
default:

0 commit comments

Comments
 (0)