Skip to content

Commit b4da5a8

Browse files
authored
Apply suggestions from code review
1 parent 52162b5 commit b4da5a8

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/Query/Builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ public function upsert(array $values, $uniqueBy, $update = null): int
752752
$filter[$key] = $val;
753753
}
754754

755-
if ($update === null || isset($update[$key])) {
755+
if ($update === null || array_key_exists($key, $update)) {
756756
$operation['$set'][$key] = $val;
757757
} else {
758758
$operation['$setOnInsert'][$key] = $val;

tests/ModelTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ public function testUpdate(): void
145145

146146
public function testUpsert()
147147
{
148-
//$user = User::upsert(['name' => 'John Doe'], ['name' => 'John Doe', 'title' => 'admin', 'age' => 35]);
149148

150149
$result = User::upsert([
151150
['email' => 'foo', 'name' => 'bar'],

0 commit comments

Comments
 (0)