Skip to content

Commit 7a84a88

Browse files
committed
Fixes
1 parent 7c82328 commit 7a84a88

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

src/Eloquent/Model.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ protected function getAttributeFromArray($key)
206206
public function setAttribute($key, $value)
207207
{
208208
// Convert _id to ObjectID.
209-
if ($key === '_id' && is_string($value)) {
209+
if ($key == '_id' && is_string($value)) {
210210
$builder = $this->newBaseQueryBuilder();
211211

212212
$value = $builder->convertKey($value);
@@ -295,7 +295,7 @@ public function originalIsEquivalent($key)
295295
$attribute = $attribute instanceof UTCDateTime ? $this->asDateTime($attribute) : $attribute;
296296
$original = $original instanceof UTCDateTime ? $this->asDateTime($original) : $original;
297297

298-
return $attribute === $original;
298+
return $attribute == $original;
299299
}
300300

301301
if ($this->hasCast($key, static::$primitiveCastTypes)) {

src/Relations/EmbedsMany.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ protected function associateExisting($model)
285285

286286
// Replace the document in the parent model.
287287
foreach ($records as &$record) {
288-
if ($record[$primaryKey] === $key) {
288+
if ($record[$primaryKey] == $key) {
289289
$record = $model->getAttributes();
290290
break;
291291
}

tests/ModelTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,6 @@ public function testFirstOrCreate(): void
10121012
$name = 'Jane Poe';
10131013

10141014
$user = User::where('name', $name)->first();
1015-
assert($user instanceof User);
10161015
$this->assertNull($user);
10171016

10181017
$user = User::firstOrCreate(compact('name'));

0 commit comments

Comments
 (0)