Skip to content

Commit d61612d

Browse files
committed
re-formatted code
1 parent 75030a1 commit d61612d

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

MysqliDb.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -821,20 +821,20 @@ protected function _buildDuplicate($tableData)
821821
}
822822

823823
foreach ($this->_updateColumns as $column) {
824-
$this->_query .= "`" . $column . "` = ";
825-
826-
// Simple value
827-
if (!is_array ($tableData[$column])) {
828-
$this->_bindParam($tableData[$column]);
829-
$this->_query .= '?, ';
830-
continue;
831-
}
832-
833-
// Function value
834-
$arr = $tableData[$column];
835-
$key = key($arr);
836-
$val = $arr[$key];
837-
switch ($key) {
824+
$this->_query .= "`" . $column . "` = ";
825+
826+
// Simple value
827+
if (!is_array ($tableData[$column])) {
828+
$this->_bindParam($tableData[$column]);
829+
$this->_query .= '?, ';
830+
continue;
831+
}
832+
833+
// Function value
834+
$arr = $tableData[$column];
835+
$key = key($arr);
836+
$val = $arr[$key];
837+
switch ($key) {
838838
case '[I]':
839839
$this->_query .= $column . $val . ", ";
840840
break;
@@ -851,7 +851,7 @@ protected function _buildDuplicate($tableData)
851851
break;
852852
default:
853853
die ("Wrong operation");
854-
}
854+
}
855855
}
856856
$this->_query = rtrim($this->_query, ', ');
857857
}

tests/mysqliDbTests.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
'updatedAt' => 'datetime',
3333
'expires' => 'datetime',
3434
'loginCount' => 'int(10) default 0',
35-
'unique key' => 'login (login)'
35+
'unique key' => 'login (login)'
3636
),
3737
'products' => Array (
3838
'customerId' => 'int(10) not null',
@@ -178,16 +178,16 @@ function createTable ($name, $data) {
178178

179179
// insert with on duplicate key update
180180
$user = Array ('login' => 'user3',
181-
'active' => true,
182-
'customerId' => 11,
183-
'firstName' => 'Pete',
184-
'lastName' => 'D',
185-
'password' => $db->func('SHA1(?)',Array ("secretpassword2+salt")),
186-
'createdAt' => $db->now(),
187-
'updatedAt' => $db->now(),
188-
'expires' => $db->now('+1Y'),
189-
'loginCount' => $db->inc(3)
190-
);
181+
'active' => true,
182+
'customerId' => 11,
183+
'firstName' => 'Pete',
184+
'lastName' => 'D',
185+
'password' => $db->func('SHA1(?)',Array ("secretpassword2+salt")),
186+
'createdAt' => $db->now(),
187+
'updatedAt' => $db->now(),
188+
'expires' => $db->now('+1Y'),
189+
'loginCount' => $db->inc(3)
190+
);
191191
$updateColumns = Array ("updatedAt");
192192
$insertLastId = "id";
193193
$db->onDuplicate($updateColumns, "id");

0 commit comments

Comments
 (0)